WordPress For Non-Techies: Free WordPress Tutorials – WPCompendium.org

How To Do A Global Search And Replace In WordPress

With WordPress, all of your content is stored inside a database (called a MySQL database or SQL file) on your server, not page files. This means that if you want to make global changes to your content like replacing text or URLs throughout your site, these changes have to be made inside your WordPress database tables.

Editing your WordPress database, however, requires having knowledge of SQL. If you are a non-coder and need to make global changes to content on your website, the best way to do this is to use a WordPress plugin.

In this tutorial, you will learn how to use plugins to easily perform a global search and replace in WordPress without touching code or editing your WordPress database tables.

How To Do A Global Search And Replace In WordPress

Being able to change content throughout your site quickly is important if you have many instances of text or links that need replacing, for example:

Imagine the following scenarios:

Let’s suppose that you run a community website promoting various local sports teams and events and one of these teams is known as the ‘Rainbow Bay Hawks.’
One day, the ‘Rainbow Bay Hawks’ decide to change their name to the ‘Rainbow Bay Eagles.’
Now you have hundreds of instances where the team’s old name appears in your content. You want to replace the old name with the new name. How can you make these changes without manually editing every instance on your site?

Also, let’s say that your WordPress site includes many published posts and pages containing images stored inside your WordPress media gallery.

As your site grows and new posts and pages get added, you then decide to move all of your images and media to an external storage location (e.g. Amazon S3) to help improve your site’s efficiency and make your pages load faster to visitors …

(Transferring images to other storage locations require replace image URLs on existing content)

This transfer changes the path (i.e. the destination URL) of your images, which requires changing the URLs of all the images that you have embedded into your posts and pages.

In most situations, it would be quite impractical to go through every post and page on your site and do a manual search and replace of all image links. Fortunately, if you are a non-tech-savvy WordPress user, plugins provide a simple solution you can use to search and replace content throughout your site without having to access your WordPress database.

If you transfer images to a different image storage location without changing the URL of the images in your content, your posts and pages will continue displaying images stored in the old location (e.g. your WordPress images folder).

If you delete your images from the WordPress images folder or change image URLs before transferring images to the new location, your posts and pages will display “missing image” errors …

(Incorrect image links lead to missing image errors)

When transferring images published on existing content to a different storage location, follow the steps shown in the order below to avoid errors:

  1. Add images to the new location
  2. Write down the destination path to the new images folder
  3. Perform a global search and replace to change the old path URL to the new destination using a search and replace plugin
  4. Delete images from the old folder or just ignore these.
  5. All of your image links will now point to the new storage location.

Search And Replace

(Search & Replace WordPress global search and replace plugin)

Search & Replace is a free plugin that allows you to perform a simple search to find strings in your WordPress database and then replace that string.

You can search for content strings in areas of your database such as ID, post-content, GUID (Globally Unique Identifier), title, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories, categories-description, and many others. You can also use this plugin to replace the user-ID in all tables and the user-login for site security purposes.

Plugin Download

You can download the Search And Replace WordPress plugin here:


Plugin Installation

To install Search And Replace, log into your WordPress dashboard, go to Plugins > Add New 

(Plugins Menu – Add New)

Type in “search-and-replace” in the Search field and click on Search Plugins

(Add Plugins Menu > Search And Replace)

Locate the ‘Search & Replace’ plugin and click Install Now to install the plugin …

(Install Search & Replace)

Activate the plugin after installation …

(Activate the plugin)

You can also activate your plugin by going to Plugins > Installed Plugins …

(WP Plugins – Installed Plugins)

This brings you to the ‘Plugins’ screen …

(Plugins screen)

Locate the ‘Search & Replace’ plugin in the ‘Plugins’ screen and click Activate

(Activate the plugin)

The plugin will be activated and ready to use …

(Search & Replace plugin is now active)

Plugin Usage

To access the plugin’s search and replace features, go to Tools > Search & Replace

(Tools > Search & Replace)

This takes you to the ‘Search & Replace’ screen …

(Search & Replace screen)

Using The Search & Replace Plugin

The Search & Replace plugin allows you to perform a number of useful functions, including:

For the purposes of this tutorial, let’s focus on searching and replacing text strings.

Click on the ‘Search & Replace’ tab …

(Search & Replace tab)

Here you can search for text or strings in all database tables, or just in specific tables, and perform global or specific search and replace operations …

(Search & Replace fields)

Backup your WordPress site before using this plugin! You cannot undo the changes made to your database by the plugin.

Using our previous example, let’s say that you want to replace all instances of the old link structure where images were being stored with links pointing to your new image folder location …

(Let’s replace all instances of this URL)

First, make a backup of your WordPress database, then go to Tools > Search & Replace and do the following:

  1. Enter the URL to be replaced in the Search for: field (1)
  2. Enter the new URL into the Replaced with: field (2)
  3. Check Select all tables to find and replace strings in all of your database tables or select only the specific database tables to perform the search and replace function by clicking on individual table items (3)
  4. As a safety precaution, we recommend leaving the Dry Run box ticked. If you uncheck this box, the plugin will begin performing a search and replace as soon as you click the start button.
  5. Click on ‘Do Search & Replace’ to begin …

(Search & Replace)

The plugin will begin searching and replacing the strings in your WordPress database and let you know when the operation has been completed …

(Search and replace results)

When performing a ‘dry run’, no changes will be made in your database. You can view the results by clicking on the ‘View details’ link …

(Search & Replace – View details)

To perform the changes, repeat the process, but change the following settings:

(Use these settings to perform the actual search and replace)

The plugin will perform the search and replace operation and save the changes to your database.

(Search and replace operation completed)

If you don’t want to save the changes to your database, you can export an SQL file with the changes instead (useful for developers) …

(Making a search and replace to SQL file instead of your actual database)

Once the operation has been performed, go back to your post or pages and check the results …

(Global search and replace performed!)

The old image links on all of your posts and pages have now been replaced.

For more information about this plugin, visit the plugin site here:

Alternative Search & Replace Plugins

In addition to the Search & Replace plugin described above, there are other search and replace plugins that you can use.

Better Search Replace

(Better Search Replace)

Better Search Replace consolidates and incorporates the best features from many search and replace plugins, incorporating the following features in one simple plugin, including:

For more details, go here}:

Real-Time Find And Replace

(Real-Time Find and Replace)

This plugin allows you to dynamically (i.e. at the time when a page is generated) replace code and text from themes and other plugins with code and text of your choosing before a page is delivered to a user’s browser. Because the find and replace happens in real-time no changes are needed to plugins or themes. A ‘PRO’ version is available with advanced/additional features.

For more details, go here}:

Text Replace

(Text Replace – WordPress Plugin)

This plugin allows you to easily define text or HTML that should be used in your posts in place of words or phrases that are actually present in the posts. This is a handy technique for creating shortcuts or content ‘placeholders’ to common, lengthy, or frequently changing text/HTML, or for smilies.

For more details, go here}:

You can search for more WordPress search and replace plugins inside your WordPress dashboard (Plugins > Add New), or the WordPress Plugin Directory …

(WordPress Plugins – search and replace)

Search the WordPress Plugin Repository for search and replace plugins below:

Congratulations! Now you know how to perform a quick global search and replace in WordPress without touching code or editing your WordPress database tables.

(Source: Pixabay)


"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya


Recommended Video Courses For WordPress Users

Google Tools

This video course will help you learn the basics of using Google Tools like Google Analytics and Gmail.

More info: Google Tools

Recommended Video Courses For WordPress Users

How To Set Up WordPress On Localhost

Learn how to install, set up, and locally host a fully functioning WordPress site on your computer.

More info: How To Set Up WordPress On Localhost

Recommended Video Courses For WordPress Users

How To Use FTP

This video course shows you how to use FTP (File Transfer Protocol) to transfer and upload files between your hard drive and your server using a free FTP program called Filezilla.

More info: How To Use FTP

Recommended Video Courses For WordPress Users

How To Set Up A Forum On WordPress

Learn how to set up a forum for your visitors, prospects, customers, members, or affiliates using WordPress.

More info: How To Set Up A Forum On WordPress

Recommended Video Courses For WordPress Users

Using Password Managers

Password Managers provide an easy and secure way to keep track of all your passwords. This video course shows you how to use two FREE powerful password management tools.

More info: Using Password Managers

Recommended Video Courses For WordPress Users

WordPress Security

Learn how to keep your WordPress site or blog secure and protected from malware, hackers and brute-force attacks.

More info: WordPress Security

Recommended Video Courses For WordPress Users

How To Use Amazon S3

Learn how to set up and use Amazon S3 to upload, store, manage, and protect your site’s images, large media files, downloadable files, stream videos and more.

More info: How To Use Amazon S3

Recommended Video Courses For WordPress Users

How To Back Up & Restore WordPress Sites

Learn how to safely and automatically backup your WordPress files and database and how to easily restore your WordPress site if something were to happen.

More info: How To Back Up & Restore WordPress Sites

Recommended Video Courses For WordPress Users

How To Install, Set Up & Use WordPress Multisite

Learn how to quickly and securely set up an online community of websites or blogs using the powerful WordPress Multisite feature.

More info: WordPress Multisite

Recommended Video Courses For WordPress Users

How To Optimize WordPress

Learn how to optimize your WordPress site and improve your page loading speed.

More info: How To Optimize WordPress