12.2.4. Action Commands
The available action commands are explained below. You can see Filter Commands to learn what commands are and how they are used.
12.2.4.1. Clear
This command clears the text. In other words, it replaces the subject value with an empty text.
12.2.4.2. Find and replace
This command finds something in the subject value and replaces it with something.
- Options
Find and replace: See Find and Replace Setting
12.2.4.3. Make upper case
This command makes all the letters of the subject value uppercase. For example, if the subject value
is NASA lands Perseverance on Mars
, then it will become NASA LANDS PERSEVERANCE ON MARS
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.4. Make lower case
This command makes all the letters of the subject value lowercase. For example, if the subject value
is NASA lands Perseverance on Mars
, then it will become nasa lands perseverance on mars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.5. Make title case
This command makes the first letters of the words in the subject value uppercase. For example, if
the subject value is NASA lands Perseverance on Mars
, then it will become Nasa Lands
Perseverance On Mars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.6. Make snake case
This command makes the letters of the subject value lowercase, replaces spaces with underscore
character, and puts an underscore character between two adjacent uppercase letters. For example, if
the subject value is NASA lands Perseverance on Mars
, then it will become
n_a_s_a_lands_perseverance_on_mars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.7. Make kebab case
This command makes the letters of the subject value lowercase, replaces spaces with dash character,
and puts a dash character between two adjacent uppercase letters. For example, if the subject value
is NASA lands Perseverance on Mars
, then it will become n-a-s-a-lands-perseverance-on-mars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.8. Make camel case
This command makes the first letter of the subject value lowercase, makes the first letter of the
words (other than the first word) uppercase, and removes the spaces. For example, if the subject
value is NASA lands Perseverance on Mars
, then it will become nASALandsPerseveranceOnMars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.9. Make studly case
This command makes the first letters of the words uppercase and removes the spaces. For example, if
the subject value is NASA lands Perseverance on Mars
, then it will become
NASALandsPerseveranceOnMars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.10. Make first letter upper case
This command makes the first letter of the subject value uppercase. For example, if the subject
value is nasa lands Perseverance on Mars
, then it will become Nasa lands Perseverance on Mars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.11. Make slug
This command makes the subject value a slug. A slug is a URL-friendly text that does not contain
characters not suitable for a URL, that is lowercase, and whose space characters are replaced with
dash characters. For example, if the subject value is #NASA lands Perseverance _on_ Mars!!!
,
then it will become nasa-lands-perseverance-on-mars
.
- Options
Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well.
12.2.4.12. Limit words
This command removes the excessive words from the subject value and, optionally, put a text at the end of the subject value if its words are cut.
- Options
Maximum word count: Enter how many words the subject value can contain at maximum End text: If you want to add a text at the end of the cut subject values, enter that text here. The text will be added to the end of the subject value only if its words are cut. Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well. - Example 1
Subject value: NASA lands Perseverance on Mars
Max word count: 3 End text: ...
Result: NASA lands Perseverance...
- Example 2
Subject value: NASA lands Perseverance on Mars
Max word count: 3 End text: Empty Result: NASA lands Perseverance
- Example 3
Subject value: NASA lands Perseverance on Mars
Max word count: 10 End text: ...
Result: NASA lands Perseverance on Mars
12.2.4.13. Limit characters
This command removes the excessive characters from the subject value and, optionally, put a text at the end of the subject value if its characters are cut.
- Options
Maximum character count: Enter how many characters the subject value can contain at maximum End text: If you want to add a text at the end of the cut subject values, enter that text here. The text will be added to the end of the subject value only if its characters are cut. Treat as HTML?: Check this if the subject’s value is HTML, and you want to work with the texts of the elements. If you do not check this in that case, then the HTML code will be considered as well. - Example 1
Subject value: NASA lands Perseverance on Mars
Max char count: 20 End text: ...
Result: NASA lands Persevera...
- Example 2
Subject value: NASA lands Perseverance on Mars
Max char count: 20 End text: Empty Result: NASA lands Persevera
- Example 3
Subject value: NASA lands Perseverance on Mars
Max char count: 100 End text: ...
Result: NASA lands Perseverance on Mars
12.2.4.14. Remove empty HTML elements
This command removes empty HTML elements and HTML comments from the subject value. The HTML tags
that do not have a content are excluded, such as img
tag.
- Options
Remove comments?: Check this checkbox if you want to remove HTML comments from the subject value. Excluded tag names: Enter the HTML tag names that must not be removed even if they do not have content in them. You should separate the tags by commas. The HTML tags that do not have a content are already excluded, such as img
tag.- Example 1
Subject value: <!-- Comment -->NASA lands Perseverance on Mars<p></p>
Remove comments?: checked
Excluded tag names: Empty Result: NASA lands Perseverance on Mars
- Example 2
Subject value: <!-- Comment -->NASA lands Perseverance on Mars<p></p>
Remove comments?: unchecked
Excluded tag names: Empty Result: <!-- Comment -->NASA lands Perseverance on Mars
- Example 3
Subject value: <!-- Comment -->NASA lands <a></a>Perseverance <i></i><b>on</b> Mars <p></p>
Remove comments?: checked
Excluded tag names: p, a
Result: NASA lands <a></a>Perseverance <b>on</b> Mars <p></p>
12.2.4.15. Remove links
This command removes the links that target specific domains from the subject value. This command can be configured in two ways. The first one is to define rules for the blocked domains. Only the links targeting one of those domains will be removed. The second one is to configure allowed domains. In that case, all the links that do not target one of the allowed domains will be removed.
- Options
Blocked domains: Enter the blocked domain rules. The links targeting one of the given domains will be removed. You can use *
to indicate the variable parts. For example,domain.com
rule does not matchsub.domain.com
, but*.domain.com
does.Allowed domains: Enter the allowed domain rules. The links targeting a domain outside of the given domains will be removed. You can use *
to indicate the variable parts. For example,domain.com
rule does not matchsub.domain.com
, but*.domain.com
does.
The following examples’ subject value is this:
<a href="https://domain1.com">Link 1</a>
<a href="https://domain2.com">Link 2</a>
<a href="https://sub.domain1.com">Link 3</a>
- Example 1
Blocked domains: Empty
Allowed domains: domain1.com
Result: <a href="https://domain1.com">Link 1</a> Link 2 Link 3
- Example 2
Blocked domains: domain1.com
Allowed domains: Empty
Result: Link 1 <a href="https://domain2.com">Link 2</a> <a href="https://sub.domain1.com">Link 3</a>
- Example 3
Blocked domains: domain1.com
and*.domain1.com
Allowed domains: Empty
Result: Link 1 <a href="https://domain2.com">Link 2</a> Link 3
- Example 4
Blocked domains: domain2.com
Allowed domains: domain2.com
Result: Link 1 Link 2 Link 3
- Example 5
Blocked domains: Empty
Allowed domains: Empty
Result: <a href="https://domain1.com">Link 1</a> <a href="https://domain2.com">Link 2</a> <a href="https://sub.domain1.com">Link 3</a>
12.2.4.16. Template
This command allows you to add a text before or after the subject value or replace it with a different value.
- Options
Template: Define the new value. You can add [wcc-item]
shortcode anywhere in the template to include the original subject value.- Example 1
Subject value: Mars Rover
Template: Incredible [wcc-item]
Result: Incredible Mars Rover
- Example 2
Subject value: Mars Rover
Template: [wcc-item], [wcc-item], the incredible [wcc-item]
Result: Mars Rover, Mars Rover, the incredible Mars Rover
- Example 3
Subject value: Mars Rover
Template: Perseverance
Result: Perseverance
12.2.4.17. Exchange attributes
This command exchanges the values of two attributes of the same element.
- Options:
Attribute names: Enter the names of the attributes whose values will be exchanged with each other. If the value of Attribute 2
does not exist, the values will not be exchanged.- Example 1
Subject value: <img src="placeholder.jpg" data-src="real-image.jpg">
Attribute 1: src
Attribute 2: data-src
Result: <img src="real-image.jpg" data-src="placeholder.jpg">
- Example 2
Subject value: <img src="image.jpg">
Attribute 1: src
Attribute 2: data-src
Result: <img src="image.jpg">
- Example 3
Subject value: <img src="image.jpg" data-src="">
Attribute 1: src
Attribute 2: data-src
Result: <img src="image.jpg" data-src="">
12.2.4.18. Remove
This command removes the element provided as the subject value from the HTML. If the element has elements inside, they will be removed as well.
12.2.4.19. Remove attributes
This command removes the specified attributes from the subject elements.
- Options
Attribute names: Define the names of the attributes that will be removed from the element. To enter multiple attributes, separate them with commas. For example, attribute1
defines only one attribute, whileattribute1, attribute2
defines two attributes. The order of the attributes is not important.- Example 1
Subject value: <img src="real-image.jpg" data-src="placeholder.jpg" data-size="large">
Attribute names: data-src
Result: <img src="real-image.jpg" data-size="large">
- Example 2
Subject value: <img src="real-image.jpg" data-src="placeholder.jpg" data-size="large">
Attribute names: data-size, data-src
Result: <img src="real-image.jpg">
12.2.4.20. Clone
This command clones the element provided as the subject value. The cloned element will be placed as the next sibling to the original element and given the ID you specified. Entering an ID is mandatory for this command, because it might be hard to interact with the cloned element if it does not have an ID. This command assumes that you want to interact with the cloned element.
- Options
Clone all found elements?: Check this if all the elements found by the provided CSS selectors must be cloned. If this is not checked, only the first one in the found elements will be cloned. Element ID: Enter the ID that will be assigned to the cloned element. You can use this ID to interact with the cloned element later. An ID attribute cannot have a space character in it, according to the specifications. However, if you enter a space-separated list, it will be considered as multiple IDs. In case of cloning multiple elements, the given ID(s) will be suffixed a number for each cloned element. For example, if the given ID is my-element my-clone
, and there are three cloned elements, while the first clone will havemy-element my-clone
as its ID, the second and third ones will havemy-element2 my-clone2
andmy-element3 my-clone3
as their IDs.
12.2.4.21. Create
This command is used to create one more HTML elements and insert them into the target page relative to a specific element defined by its CSS selector. If there are multiple target elements, a new HTML element will be created and inserted for each of them.
- Options
Location: Select the location of the new HTML element relative to the target element, which is the element specified via its CSS selector. For example, “After” means that the new HTML element should be inserted just after the target element, as a sibling. “Inside Top” means that the new HTML element should be inserted inside the target element as the first child. Short codes: Short codes that can be used in the code of the new HTML element. You can hover over the short codes to see what they do. You can click to the short code buttons to copy the short codes. Then, you can paste the short codes into the new HTML element’s code to include them. They will be replaced with their actual values. New element’s HTML code: Define your HTML element. The code you enter here must be a valid HTML code. If it is not valid, you might get unexpected results. Otherwise, your element will be created and inserted into the specified location. - Example 1
Subject value: <div> <h1>Title</h1> </div>
Location: After
New element’s HTML code: <div>My element</div>
Result: <div> <h1>Title</h1> </div> <div>My element</div>
- Example 2
Subject value: <div> <h1>Title</h1> </div>
Location: Before
New element’s HTML code: <div>My element</div>
Result: <div>My element</div> <div> <h1>Title</h1> </div>
- Example 3
Subject value: <div> <h1>Title</h1> </div>
Location: Inside Top
New element’s HTML code: <div>My element</div>
Result: <div> <div>My element</div> <h1>Title</h1> </div>
- Example 4
Subject value: <div> <h1>Title</h1> </div>
Location: Inside Bottom
New element’s HTML code: <div>My element</div>
Result: <div> <h1>Title</h1> <div>My element</div> </div>
12.2.4.22. Unwrap
This command removes an element’s tags, while keeping its content.
- Example 1
Subject value: <div> <h1>Title</h1> </div>
Result: <h1>Title</h1>
- Example 2
Subject value: <h1><span>My</span> Title</h1>
Result: <span>My</span> Title
12.2.4.23. Calculate
This command calculates a value by using the subject value and replaces the subject value with the result of the calculation.
Important
Although this command lets you assign a thousands separator and use ,
as the
decimal separator, the result will not be a valid number when you do these. For the command to be
able to result in a number when the subject value is a number, you must use .
as the decimal
separator, and you must not use a thousands separator.
- Options
Decimal separator: Select the decimal separator to be used in the resultant number. The one that is not selected will be used as the thousands separator. Use thousands separator?: Check this if you want to use thousands separator in the result. Precision: Enter how many digits at max there can be after the decimal separator. Default: 0
Formula: Enter formulas that will be used to create the new value. If you enter more than one, a random one will be used. Use x
orX
to include the original value. For example, you can writex * 3^2
to multiply the number by9
. You can use the following operators:*
,+
,/
,-
,^
12.2.4.24. Send email notification
This command sends an email to the email addresses specified in Email addresses setting. Also, the notifications must be activated via Notifications are active? setting. If the notifications are not active, or there are no email addresses defined, this command does not send an email notification.
- Options
Title: Title of the notification. You can use the short codes shown at the top of the command container to include certain information into the template. If you leave this empty, a default template will be used. However, the default template will not include specific information that you can use to differentiate notifications. Hence, it is recommended that you enter a descriptive value. Message: Enter the message that will be sent as a notification. You can use the short codes shown at the top of the command container to include certain information into the template. If you leave this empty, a default template will be used. However, the default template will not include specific information that you can use to differentiate notifications. Hence, it is recommended that you enter a descriptive value. Notification identifier: A text that will be used to identify this notification to limit the number of same-type notifications to be sent. Getting numerous notifications about the same thing will probably bother you. To prevent this, just enter a text so that the plugin can reduce the number of notifications. If you leave this empty, the notifications will not be limited. You can use the same identifier for other notification commands as well. For example, you can enter notification-about-low-price
. When a notification is sent, the date of the notification will be stored for this identifier. The date will be checked before sending another notification.Notification interval (in minutes): This defines the minimum duration between two notifications, in minutes. For example, if you enter 30
, you will not get more than one notification within30
minutes. For this to work, you have to define the notification identifier as well. If you leave this empty, the default value will be used, which is30
.- Short codes
[wcc-request-url]
:URL of the page being crawled [wcc-status-code]
:HTTP status code of the response of the crawl request. E.g. 400
,403
,200
,500
, etc.[wcc-site-name]
:Name of the site, defined by you [wcc-site-id]
:ID of the site [wcc-site-edit-url]
:The URL that displays the site edit page [wcc-current-time]
:Current date and time, e.g. 2021-02-24 09:25:52
12.2.4.25. Stop
This command stops the execution of the crawling operation immediately. If there is a post that is
already saved for the current URL, it will not be deleted. If this is executed during the crawling
of a multi-page post, the status of the post will remain as draft
.
- Options
Reason: A short explanation about why the crawling should be stopped. This will be added to the log message and to the information messages that you will see when this command is run. This is optional. If you define this, you will be able to understand why this command is run when it is run.
12.2.4.26. Stop and delete the post
This command stops the execution of the crawling operation immediately. Then, deletes the post created in your site for the current URL (the URL being crawled), if the post exists.
- Options
Reason: A short explanation about why the crawling should be stopped and the post should be deleted. This will be added to the log message and to the information messages that you will see when this command is run. This is optional. If you define this, you will be able to understand why this command is run when it is run. Delete URL?: Check this if the URL of the post should be deleted from the database. When the URL is deleted, the plugin will be able to save the URL to the database again, if the URL is found in a category page. This means that the post can be saved again. If the URL is not deleted, the post will not be saved again.
12.2.4.27. Set author
This command assigns the author of the post.
- Options
Author: Select the author that will be assigned to the crawled post.
12.2.4.28. Set featured image
This command assigns the featured image of the post.
- Options
Featured image IDs: Define the ID of an image that will be used as the featured image of the post. If you define multiple image IDs, one of them will be used randomly.
12.2.4.29. Set post status
This command assigns the status of the post, such as Draft
or Pending
.
- Options
Post status: Select the status that will be assigned to the crawled post.
12.2.4.30. Add tags
This command adds tags to the crawled post. It can also delete the existing tags.
- Options
Tags: Define the tags that will be added to the tags of the post. To enter multiple tags, separate them with commas. For example, my tag
defines only one tag, whilemy, tag
defines two tags.Delete other tags?: Check this if you want to delete other existing tags, if any exists.
12.2.4.31. Add categories
This command adds the crawled post under the given categories. It can also delete the existing categories.
Important
If you want the defined categories not to be added under the main category selected in Category URLs setting, you must enable Do not add the category defined in the category URLs? setting.
- Options
Categories: Enter the categories. Add a new item for each top-level category. You can add child categories to the top-level category by separating them with >
character. For example,Cities
puts the post under that category, whileCities > Metropolitan > Chicago
puts it under the last category after creating its parent categories.Delete other categories?: Check this if you want to delete other existing categories, if any exists. This does not delete the categories from WordPress. This just removes the post from those categories.
12.2.4.32. Field template
This command is used to apply a template to multiple fields of the post. For example, if you want to prepend a text to the title, content, and tags, you can use this command to prepend that text to all these fields.
- Options
Fields: Select the fields that will be changed by using the template. If there is no field selected, no field value will be changed. Short codes: Short codes that can be used in the template. You can hover over the short codes to see what they do. You can click to the short code buttons to copy the short codes. Then, you can paste the short codes into the template to include them. They will be replaced with their actual values. Template: Enter your template. What you define here will be used as the new value of the specified fields. The original value will be replaced with this template. - Example 1
Subjects: Title: My title Slug: my-post-slug Content: <div>My content</div>
Tags: tag1, tag2 Fields: Title
,Content
,Tags
Template: My prefix - [wcc-item]
Result: Title: My prefix - My title Slug: my-post-slug Content: My prefix - <div>My content</div>
Tags: My prefix - tag1, My prefix - tag2