There are many reasons why you need to do a search and replace in WordPress. It could be that the article you have written on your mobile device has plenty of typographical errors (due to your keyboard’s autocorrect function) and you want to fix them all with a search and replace. Alternatively, it could be that you updated your database or switched to a new web host, and some weird characters are showing up in your posts. Regardless of the situation, it is always handy to have a search and replace function in WordPress. Most text deditors come with this function, so why not WordPress?

Search and Replace button in WordPress Post editor

If all you need is to add a Find/Replace button in post editor so you can easily fix up the typographical errors in the article, TinyMCE Advanced is the best plugin that you can use.

After it’s installed, you can go to “Settings -> TinytMCE Advanced” to find a list of buttons that you can add to the post editor. One of them is the “Find/Replace” button. Drag that icon to the editor menu and click “Save Changes.”

wp-tinymce-advanced-find-replace-button

Next, go to your Post editor, and you should be able to find the “Find/Replace” icon in the toolbar. This is what you will see when you click on it:

wp-tinymce-advanced-find-replace-dialog-box

Similar plugins that you can use include WP Edit and WP Super Edit.

Search and Replace text in all posts/pages/custom post type

If the mistake that you are rectifying occurs in all posts or pages, then the Find replace plugin is the one for you. What it does is search through all your posts/pages/custom post types for the search string and replaces it with the corrected string. This is particularly useful when you migrate to a new domain and want to change all the links from the old domain to the new URL.

wp-find-replace-plugin

Once installed, you can find the tool in the “Plugins -> Find and replace” section. One good thing about this plugin is that other than post content, it can also change postmeta value.

Search and Replace value in the database

Instead of text in the post content, if what you are changing is a site-wide value, including plugin settings, system settings, etc., you will have to edit the database directly. Luckily there is a tool for this. The Search and Replace plugin allows you to find strings in your WordPress database and replace them with another string. You can search in ID, post-content, GUID, title, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories and categories-description. It is also possible to replace the user-ID in all tables and the user-login. As you can see, this is a powerful tool, and any mistake that you make might break your WordPress database. Only use this if you know what you are doing, and do backup your database before you proceed.

wp-search-replace-all-search

After the installation, go to “Tools -> Search & Replace.” There are two options: you can choose to do an “All search (and replace)” or select the database table to search and replace. The search is case sensitive and has no pattern matching capabilities. You can perform a search first without replacing and verify that the data you are replacing is correct. After that, you can then proceed to do a search and replace.

wp-search-replace-custom-search

One thing to note is that this Search & Replace plugin doesn’t search serialized data. Technically it means that if a plugin saved its data in array format, its value cannot be modified by “Search and Replace.” Only the text value will be searched and replaced.

Conclusion

Depending on the degree of search and replace function that you want to carry out, there is a plugin available for you. The last method that you can use is to amend the database value directly via phpmyadmin, but that is too technical and is not recommended for everyone. Let us know if you have come across another useful search and replace plugin not mentioned above.

Image credit: tango edit find replace

How To Open Multiple Links in Chrome

You might come across a webpage with several links that you want to check them out. If you’re looking for a fast, efficient way to open links in the fastest way possible, then LinkClump might just help you with that.

How to Easily Enable Real-time Collaboration on Your Site

If you are a webmaster, you might be thinking of how you can make your website more interactive, or even allowing your visitors to collaborate with one another. TogetherJS allows you to easily add a real-time collaboration feature to your site with minimal technical/coding skill.

How to Create QR Code in Google Drive

There are tons of ways to create QR code. If you are a Google Drive user, here is one quick way to create R code in Google Document

Identity Theft on The Internet: Can You Prevent It?

What if someone else had enough information about you from the web to become you? What can you do to prevent identity theft? We’re here to help you out.

Secure Your Yahoo Account With Second Sign-in and App Password

Yahoo has added a feature called Second Sign-in that allows you to secure Yahoo account with two factor authentication. Here’s how you can enable it.

Quickly Access Your History in Mobile Firefox For Android

If you are using mobile Firefox in your Android devices, here is one neat trick that you can use to quickly access your browsing history.

4 Great Ways to Take And Edit Screenshots in Google Chrome

Taking screenshots can be time-consuming. Here are 4 screenshots tools for Google Chrome that allow you to snap and annotate screenshots all in the browser.

Still Need a 2014 Calendar? Make One Using Pically

Are you still looking for the perfect 2014 calendar. Pically is a free program that you can grab and use to create beautiful calendars using your own photos.

Light – A Lightweight and Speedy Firefox Alternative

Light is a lightweight browser built with speed in mind and is ideal for old machines. It is a Firefox alternative with several non-essential features removed.

What You Need to Know About Future Web Standards (That are Making the Internet Better)

The Internet started 40 years ago and many things have changed since then. Let’s take a look at the future web standards and how they improve the Internet.

Replace and Enhance Browsers Capability With These Addons

Your browser comes with some capabilities that have become obsolete. Here are some extensions to enhance browsers capability and performance.

Reader vs iReader: The Battle of the Readability Extensions

Reader and iReader for Firefox are two great extensions to implement a “Reader mode” in Firefox, but which is better? Let’s find out.