WOLF - WordPress Posts Bulk Editor and Manager Professional

Bulk Search and Replace in WordPress Posts, Titles and SEO Fields

A bulk search and replace in WordPress posts usually starts with a small change that appears everywhere: last year's date in two hundred reviews, a renamed product in titles, an old brand name in Yoast meta descriptions. In WOLF it takes two steps. The Filters tab finds the posts that contain the text, and the replace behaviour in the Bulk Edit tab swaps the text in every one of them. The two steps match text in different ways, and knowing that difference is what makes the job predictable.

How bulk search and replace works in WOLF

The search and the replace are separate tools with separate rules:

  • The search is a database pattern. The text filters of the Filters tab compare your text with the stored title, content or excerpt inside the database query, where some characters have a special meaning (see Step 1).
  • The replace is a plain text substitution. For each post in the operation, WOLF reads the stored value, replaces every occurrence of your text, character for character, and saves the post. There are no wildcards and no patterns.

Which posts the operation touches is shown in the notice at the top of the Bulk Edit tab, Bulk editing will be applied to:. Posts selected with the checkboxes in the Posts Editor take priority. Without a selection, the filtered posts are used. With neither, every post of the current post type is used.

Always filter first, even though the replace only changes posts that contain the text. Every post in the operation is saved, including the ones where nothing was found. Each of them gets a new Date modified and an entry in the History. A filtered run touches only the posts that really need the change.

Step 1: find the posts that contain the text

Open the Filters tab. The text inputs [post] title ..., [post] content ..., [post] excerpt ... and [post] slug ... each have a behaviour drop-down next to them:

BehaviourFinds posts where the field
LIKEcontains the text anywhere
EXACTis exactly the text, nothing more
NOTdoes not contain the text
BEGIN / ENDstarts or ends with the text
Emptyis empty

Type the text, choose LIKE and click Filter. The search ignores letter case. Check a few of the matching posts before you go on.

Characters to leave out of the search

Technically, LIKE, NOT, BEGIN and END are MySQL regular expressions. Letters, digits, spaces and hyphens match themselves. These characters do not: . [ ] ( ) * + ? | $ \ { }. A dot matches any character, which only widens the result a little. Square brackets do more damage: in [sc name="product-code"][/sc] they turn the text into "one character from this list", so the filter returns far too many posts or none at all. Search a distinctive part without such characters instead, for example product-code. Leave apostrophes out as well and search the part of the phrase before or after them. None of this applies to Step 2: the replace is not a pattern, so brackets, parentheses and dots are safe there.

Several words, AND and NOT

One input can hold several conditions. 2019^2020 finds posts that contain either year. chainsaw^~2019 finds posts that contain both words. chainsaw^!2024 finds posts with "chainsaw" but without "2024". Put the ! parts at the end. The Filters documentation and the FAQ on searching several titles at once have more examples.

Search for what is stored, not what is displayed

The content filter searches the HTML that WordPress stores. In the block editor that is what you see in the Code editor view, block comments included. An ampersand is usually stored as &amp;, and a phrase with bold text in the middle (buy <strong>now</strong>) is not the plain text "buy now". The same goes for shortcodes. The title and content cells of the Posts Editor show the stored text with shortcodes as raw text, because WOLF shows values for editing and never renders them. That raw text is exactly what the search and the replace work on.

Step 2: replace the text in the Bulk Edit tab

  1. Open the Bulk Edit tab and read the notice at the top. It should say the filtered [post], or the number of selected posts.
  2. Tick the checkbox of the field you want to change: title, content, excerpt or another text field. The field's inputs become active.
  3. Set its behaviour drop-down to replace. A second row appears.
  4. In the first input, type the text to find, exactly as it is stored.
  5. In the second row, choose same case or ignore case and type the new text into replace to text. Leave it empty to delete the found text.
  6. Click Do Bulk Edit and confirm the dialog that lists the fields to be edited.

Same case replaces only exact matches, so "Chainsaw" is left alone when you search "chainsaw". Ignore case replaces both. You can change several fields in one run: tick the content and the excerpt, each with its own find and replace text.

The variable drop-downs insert {TITLE}, {ID} and {MENU_ORDER} at the cursor, and they work in both inputs. WOLF fills them in for each post. For example, replacing "Read the full review" with "Read the full review of {TITLE}" names each post in its own text.

TaskFieldText to findReplace to text
Update a year in articlescontentto buy in 2024to buy in 2026
Rename a product in titlestitleModel X200Model X300
Delete a line from every excerptexcerptUpdated weekly.(empty)

Make the text to find as specific as you can. "2024" alone would also change prices, model numbers and links that happen to contain those digits. Because the replace is literal, it cannot handle a value that changes from post to post, such as a different image ID inside every shortcode. Each distinct string needs its own run.

Replace text in Yoast SEO titles and meta descriptions

SEO plugins keep each post's custom SEO title and description in post meta. Yoast SEO uses the keys _yoast_wpseo_title and _yoast_wpseo_metadesc. To search and replace in them, make them WOLF columns first:

  1. In the Meta Fields tab, add both keys with Add Custom key by hands. You can also enter the ID of a post that has a custom SEO title under Get meta keys from any post by its ID and keep the keys you need. Give them readable titles such as "SEO title", set the type to string and click Save meta fields.
  2. In the Settings tab, enable the two new columns and click Save all settings. Only active columns appear in the Filters and Bulk Edit tabs.
  3. Filter with the new meta text filter and run replace on the meta field in the Bulk Edit tab, exactly as above.

The meta text filters work differently from the title and content filters: their LIKE is a plain "contains", so brackets and dots are safe there. More on them in filtering posts by custom field.

Yoast stores a value only when someone typed a custom title or description for that post. All other posts get theirs from the templates in Yoast's own settings, which use variables such as %%title%% and %%sitename%%. Those posts have nothing to find in the meta field, so change the template in Yoast instead. Other SEO plugins use their own keys: find them with Get meta keys from any post by its ID on a post where you set a custom SEO title.

Example: remove "(copy)" from duplicated post titles

The Duplicate button of the Posts Editor gives every copy the original title followed by " (copy)", translated when your admin runs in another language. There is no setting to turn the suffix off, but one replace removes it from all copies:

  1. In the Filters tab, filter the title with LIKE and the text copy. Do not type (copy), because parentheses are pattern characters. To leave out older titles such as "Copywriting basics", also set By author to yourself and Date Published from to the day of duplication. Copies belong to the user who made them and are dated at that moment.
  2. In the Bulk Edit tab, enable title, choose replace, type (copy) with the leading space, choose same case and leave replace to text empty.
  3. Click Do Bulk Edit.

Copies are created as published posts. If they should not be public yet, set post status to draft in the same Bulk Edit run. Their slugs were generated from the title with the suffix, for example summer-sale-copy, and changing the title does not change the slug of a published post. Run a replace on the slug field, or regenerate slugs as described in copying the title into the slug. WordPress keeps slugs unique, so a copy of summer-sale becomes summer-sale-2.

Test, check and undo

  • Test on two or three posts first. Select them with the checkboxes, which take priority over the filter, run the replace and look at those posts on the site. Then clear the selection and run it on the whole filtered set.
  • Undo from the History. Every bulk run is recorded in the History tab and can be reverted as a whole or post by post. The History covers edits, not deletions.
  • Clear page caches after the run if the site still shows the old text.
  • The filter found the posts but nothing changed: compare your text to find with the cell in the Posts Editor character by character. The usual difference is a space, an HTML entity, a line break or a capital letter while same case is selected.
  • The filter finds almost everything: the search text contains a pattern character such as [ or (. Search a shorter, plain part.

The Bulk Edit tab documentation describes the other text behaviours (append, prepend, new). If a replace still does not do what you expect, post the field, the text to find and an example post on the WOLF support forum.