INSIGHTS / Article

Article / / 3 min read

Using Better Search Replace to Update Data in WordPress Tables

How the free Better Search Replace plugin lets you find and replace text across your WordPress database, from site migrations to bulk content fixes.

SCND DigitalWordPress & Webflow studio
BetterSearchReplace

Better Search Replace is a WordPress plugin that makes it easy to search for and replace text in your WordPress database.

It’s very useful for editing data across database tables, especially when migrating a site, changing URLs, or fixing content in bulk.

A Content Mistake

One of our clients recently added more than a thousand blog articles to their website. Because the writer didn’t know much about SEO, the articles’ code used H1 for several sections. A page should have only one H1. This naturally lowered the SEO score, so adding the articles actually reduced the site’s visibility in search engines. Their SEO score in Ahrefs dropped to 20% from 100%.

In this case, we recommended a free plugin from the WordPress plugin directory: “Better Search Replace.” Because they used ACF for their content, we replaced every “<h1” with “<h2” and every “</h1>” with “</h2>” in the postmeta table. Using this plugin saved us from editing each post by hand, and their SEO score went back to 100%.

What Better Search Replace Is Good For

Replacing URLs During a Site Migration
If you move a WordPress site from one domain to another, or from a local environment to a live server, you need to update every URL stored in the database. Better Search Replace lets you replace old URLs with new ones across multiple database tables.

Editing Content in Bulk
If there’s a word or phrase in your posts or pages you want to change everywhere, you can use this plugin instead of editing each one manually.

Updating Media Paths and Internal Links
When you change domains or move your media folder, some image URLs and internal links may still point to the old path. This plugin helps you update them quickly.

Fixing Database Errors
Errors sometimes creep into the database, such as odd characters caused by incorrect encoding or changes in text formatting. With Better Search Replace, you can swap the wrong characters or formatting for the right ones.

Updating Meta Data and Custom Fields
The plugin is also handy for updating data in post meta, user meta, or other custom fields stored in the database.

How to Use Better Search Replace

Install and Activate the Plugin

Go to the WordPress Dashboard → Plugins → Add New.

Search for Better Search Replace.

Click Install Now, then Activate.

Open the Better Search Replace Menu

Once it’s active, go to Tools → Better Search Replace.

Search and Replace Your Data

  1. In the Search for field, enter the text you want to replace.
  2. In the Replace with field, enter the new text.
  3. Select the tables to update (for example, wp_posts to change content in posts).
  4. Check the Run as dry run? option if you want to run a simulation first without changing any data.
  5. Click Run Search/Replace.

Verify the Changes
When the process finishes, check that the data has changed the way you intended. If it looks right, run it again without the dry run option to actually apply the changes.

Better Search Replace is a very useful tool for managing changes to a WordPress database safely and efficiently. It makes site migrations, URL updates, error fixes, and large-scale data edits easier, without needing direct database access through phpMyAdmin.

If you’re having problems with your WordPress site, we’ll help you find the most effective and efficient solution. We offer consultations on any WordPress website issue, from a broken layout and setting up new plugins to customizing your theme the way you want it.

Visit this page to learn more.

NEED A MORE SPECIFIC ANSWER?

We’ll check your website for free.

Send us your website address. We’ll give you a picture of its condition and recommendations you can act on right away.

Check my website