Search and Replace Plugin (CMSR) - Replacement Rules


Replacement Rules

Back to User Guide

Permanent Changes?

By default, the Search and Replace plugin does not make permanent changes to your content.

Once you create replacement rules, they will be applied to visitors only while they access the page.

Learn about saving changes permanently: Search and Replace Plugin (CMSR) - Saving Changes to the Database

Navigate to Admin Dashboard â†’ Search & Replace â†’ Settings â†’ Replacement Rules tab. 

Navigation to the dashboard for managing replacement rules - WordPress Plugin to Mass Replace Links
Navigation to the dashboard for managing replacement rules

On the top of the tab you can find the search field and two checkboxes "from" and "to". It will help you to search and navigate between multiple replacement rules that you can create.

Bar for searching the replacement rules - Search and Replace Plugin
Bar for searching the replacement rules

Lower is located a list with the replacement rules that you've created.

Table with created replacement rules - Search and Replace Plugin
Table with created replacement rules

There are options to change:

  • From String / To String - Which string will be searched and then replaced.
  • Case - If enabled, the rule will be case sensitive (e.g. will differentiate "a" and "A").
  • Regex - If enabled, the From String and To String fields will be parsed for Regex rules. Learn more: Using Regex.
  • Pause - If enabled, the rule will not be applied. Useful for testing.
  • Add restrictions / Locations - Learn more below.
  • Options:
    • Update Rule - Update the rule after you've changed something.
    • Implement in DB - Clicking on this button will commit the changes straightly in the database. Learn more: Saving Changes to the Database.
    • View Related Posts - Clicking on this button will show you the list of all posts and pages where the From String rule was found. There you can choose all posts where you want to commit a replacement rule and add them to inclusion or exclusion lists using buttons Insert into Include and Insert into Exclude. You can also use a search bar in the appearing pop-up to filter related posts. Note: this feature was introduced in version 1.4.8.

      Checking the posts where the replacement rule is applied - WordPress Plugin Search and Replace
      Checking the posts where the replacement rule is applied
    • Delete Rule - Click it to delete the rule.

Adding Restrictions

The plugin allows to restrict each rule in three ways:

1) Timeframe 

Click on the box for Add Timeframe.

A new box appears to set a date and time for the restriction. 

Setting the dates means that this rule will be applied only between the date range defined in the restriction. 

You can add more than one timeframe.

Adding timeframe - WordPress Plugin Search Database and Replace
Adding timeframe

Important: when you set a date and time for the restriction, you need to know that this option works according to the Universal time - and it can be different from the local time that you set in your site settings. To check it, navigate to Admin Dashboard â†’ Settings â†’ General and scroll to the option Timezone.

Site timezone settings - Find and Replace Plugin WordPress
Site timezone settings

There are displayed Universal time and Local time.

For example, the case that you see on the screen we have a difference in 3 hours between universal and local time set on the site. So, if we want the replacement rule work from 12 to 13 o'clock according to the local time, we need to set the time in the Add Timeframe option from 9 to 10 o'clock.

2) Restrictions

Click on the box for Add Exclusion

A new box appears with set of checkboxes.

Adding exclusions - WordPress Plugin to Mass Replace Links
Adding exclusions

Each of the checkboxes allows to exclude given rule from working in associated area. For example, checking Site Title means that, even if the General Settings say otherwise, this rule will not work in titles.

The list of available restrictions are:

  • Site Title
  • Page Title
  • Content
  • Excerpt
  • Links (this restriction was introduced in version 1.5.9)
  • Images (this restriction was introduced in version 1.6.1)
  • Comments

3) Location

Choose between:

Choosing where to apply the rule - Search and Replace Plugin
Choosing where to apply the rule
  • All - All content will be considered.
  • Include - You can define specific posts or pages where the rule will be applied despite the General Settings.
  • Exclude - You can define specific posts or pages where the rule will not be applied despite the General Settings.
  • Categories/Tags - You can select specific post categories or tags to which the replacement rule should be applied. Note: this option was introduced in version 1.6.6.

Select one or multiple posts or pages.

Choosing where to apply the replacement rule - Mass Replace Text in WordPress
Choosing where to apply the replacement rule

Reorder Rules using Drag and Drop

Rule Order

The Search and Replace plugin works on the rules in the order you set them. This is specially relevant if some of them overlap.

You can reorder them at any time.

Since the order of the rule has a great implications on the output of the content, you can change the order by using a drag and drop interface.

Changing the order of the replacement rules - Search and Replace Plugin
Changing the order of the replacement rules

Define Number of Rules Per Page

You can add pagination support or display all rules on one screen using the settings found under the Settings tab.

Enabling pagination in the replacement rules table - WordPress Plugin Search and Replace
Enabling pagination in the replacement rules table

Adding More Rules

Under the list of created rules, you can find the form for creating a new rule. Just fill all needed information, configure the options and click the Add New Rule button.

Form for adding new replacement rule - WordPress Plugin Search Database and Replace
Form for adding new replacement rule

To save the changes, click on the Save Changes button at the bottom of the page.

Saving the changes - Find and Replace Plugin WordPress
Saving the changes

Under the list of created rules, you can also find the button Save All Changes. It can be useful in case if you edit a few rules - there's no need to click Update for each that rule, you can just click the button Save All Changes to update all rules that you've edited at once.

Updating all replacement rules - WordPress Plugin to Mass Replace Links
Updating all replacement rules

More information about the Search and Replace Plugin for WordPress

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.