WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Plugins» How to do Search and Replace in WordPress with a Plugin

How to do Search and Replace in WordPress with a Plugin

Last updated on October 16th, 2015 by Editorial Staff
219 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to do Search and Replace in WordPress with a Plugin

Are you looking to do search and replace in WordPress? Recently, one of our users asked us how to run search and replace on WordPress database without writing any SQL code or using phpMyAdmin. Many beginners are not comfortable with code, so that’s why we found a search and replace plugin for WordPress. In this article, we will show you how to do search and replace in WordPress.

Search and replace text in WordPress database

Getting Started

It is extremely important that you create a complete WordPress backup before making any changes to your WordPress database.

Make this best practice a habit, things can go wrong anytime when you are making direct changes to the WordPress database. If you have a backup, then you can easily restore your WordPress site without losing anything.

Installing and Using Better Search and Replace for WordPress

First thing you need to do is install and activate the Better Search Replace plugin. Upon activation, you need to visit Tools » Better Search Replace page to use the plugin.

Better search replace plugin settings

Simply add the text string you want to search for and then add the replace text.

After that you need to select the tables you want to look into. For example, if you want to search and replace some text in your posts then you may want to select the posts table. You can also select multiple tables if you want.

Learn more about WordPress database management and what each table does in WordPress.

The plugin can run a case sensitive search and replace. It can also perform a dry run which allows you to see how many cells are affected by your search without actually replacing the text.

When you are satisfied, click on run search/replace button. If you did not check the dry run option, then the plugin will now run search and replace on your WordPress database.

Troubleshooting

You may see the white screen or run into timeouts while performing a search and replace. Simply click on the settings tab under the plugin page.

Troubleshooting timeouts during search and replace

You will notice the max page size option. Try decreasing the page size to avoid timeouts and white screen.

That’s all, we hope this article helped you find a better search and replace plugin for WordPress database. You may also want to see our tutorial on how to clean up your WordPress database for improved performance.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

219 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

21 Comments

Leave a Reply
  1. Paul G says:
    Dec 10, 2020 at 6:26 am

    Thanks, this mostly worked for me but didn’t quite change all of the image links.

    The rest I could easily change myself by editing the custom modules.

    Reply
    • WPBeginner Support says:
      Dec 10, 2020 at 10:01 am

      Glad our guide was helpful :)

      Reply
  2. Karol says:
    May 31, 2019 at 4:56 pm

    Changed a website from http to https via cpanel; green lock did not appear and “connection is not secure” warning was present. This plugin worked great for me. The only difference I did was that I left the checkmark off “Case Insensitive?”.

    Every site can be different with it’s own hurdles to jump through but the dry run seemed to look okay without any errors so I ran with it. Green lock appeared right away for the site. Plugin worked for me. I hope it continues to work with other sites.

    My only question now is … Do I leave the Better Search Replace plugin installed and activated or do I uninstall it now that I’m done?

    Reply
    • WPBeginner Support says:
      Jun 3, 2019 at 11:33 am

      That would be a personal preference question but you should be able to remove the plugin without worry :)

      Reply
  3. Mandy says:
    Jan 31, 2018 at 12:12 pm

    Hello,

    My site is having issues showing images lately, and my host said that it’s because the paths are wrong. They recommended this plug in, but my problem is that I am not sure what I am searching and replacing. Here’s why:

    When I insert an image in “visual” mode within a post, it shows up. They all do.
    Then when I preview or publish, some images don’t show up. What I am noticing lately is that instead of the code showing them as “image.jpg”, they now have the image size you choose in the path – “image-300×188.jpg” (this happens to be the medium size for this particular image). Why is it putting the pixel dimensions? If none of the images worked, I could say yes, the paths are incorrect, but some images DO work! I am officially bamboozled. It seems so random.

    Best,

    Mandy

    Reply
    • WPBeginner Support says:
      Jan 31, 2018 at 5:58 pm

      Hi Mandy,

      Please take a look at our guide on how to fix common image issues in WordPress.

      Reply
  4. Ashraf Ali says:
    Mar 18, 2017 at 7:05 am

    I am switching from http to https now the common problem faced is broken css, I am wondering if could use this plugin to replace https:// to just //

    So that all contents are delivered over https

    Cheers

    Reply
  5. Drew says:
    Oct 6, 2016 at 6:44 pm

    I had a program enter structured data that is all different. I want to remove everything between and including this : ———————-

    How would I do that?

    Reply
    • WPBeginner Support says:
      Oct 6, 2016 at 7:00 pm

      Hi Drew,

      We are not sure we completely understand your issue. However, we are guessing that you had a plugin to add structured data and now you want to remove the structured data from your WordPress posts and pages? If this is the case, then you can simply uninstall the plugin.

      Reply
  6. Sueli says:
    Sep 5, 2016 at 1:05 am

    Great plugin!

    I have a question.
    Can I use a wildcard?

    I am trying to remove numbers added after an image file. They are different (both the numbers and their length). The stop point would be the (“).

    Some examples of what I want to replace with (jpg”)
    (jpg?11906004322295206140″)
    (jpg?15231215847335105667″)
    (jpg?82668654789154738″)

    Is it possible with this plugin?

    Thanks

    Reply
  7. David says:
    Jul 27, 2016 at 10:43 am

    I download “Better Search & Replace. Once it found entries, it doesn’t show me unless I buy premium addon.

    So instead I ditched that and downloaded “Search & Replace”. It took me only two minutes to replace 100 entries.

    Reply
  8. Ralpheal says:
    Jul 25, 2016 at 9:02 pm

    Wow thanks so much, this is truly a luxury. Going to save me a lot of time, as I was considering changing a phone number on 1oo’s of blog posts.

    Thanks so much, :)

    Ralpheal

    Reply
  9. Mike says:
    Jun 18, 2016 at 8:51 pm

    This plugin did not work for me. I backed up the database, then unchecked “Dry Run”. It messed up things all over the site and there was no way to undo the changes.

    I even tried to restore the database backup I created with it before making changes and that didn’t work. Don’t use this unless you’re prepared to do an entire site restoration.

    Reply
    • WPBeginner Support says:
      Jun 19, 2016 at 7:50 pm

      You should have tested with dry run first to see how many rows are affected by the plugin. Glad that you followed the instructions and made a backup first.

      Reply
  10. vikas kumar says:
    Nov 25, 2015 at 2:02 am

    sir
    help me out from pagination error i did which you show in video but i didn’t get result
    i am using macbook air in this your given shortcode not work properly

    Reply
  11. Marko Tiosavljevic says:
    Oct 18, 2015 at 5:58 pm

    yes, but this plugin is practically useless when it comes to migrations.

    When you migrate website from domain . com to another . com you need to change

    you need to connect to database for changing url or you need to insert it in wp_config as url

    i am working on external app wp safe mode that is solving this problems in best way.

    Reply
    • WPBeginner Support says:
      Oct 18, 2015 at 6:11 pm

      It is highly useful in performing search and replace after you have connected to the WordPress database.

      Reply
  12. Nico says:
    Aug 24, 2015 at 11:58 am

    Hi, it seems that this plugin is no longer available in WordPress Plugin Directory. Which alternative plugin do you recommend?

    With kind regars,
    Nico.

    Reply
    • Syed Umair Umar says:
      Nov 25, 2015 at 4:37 pm

      Better Search and Replace is an alternate for me. The editorial staff of WP Beginner seems too lazy and replies to comments very few times.

      Reply
      • WPBeginner Support says:
        Nov 25, 2015 at 9:36 pm

        Thanks for helping out.

        Reply
  13. Brian says:
    Sep 30, 2010 at 1:46 pm

    Does this take into account serialize data or will it break plugins that use serialized metadata? I know of a few plugins that do this for migration purposes. If it doesn’t it could cause more problems than it solves.

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
SeedProd Logo
SeedProd
Create beautiful custom landing pages - Drag & drop builder. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
SendinBlue Coupon Code
Sendinblue Coupon
Get Sendinblue, a powerful marketing automation toolkit for small businesses, for FREE.
InMotion Hosting
InMotion Hosting Coupon
Get an exclusive 50% off InMotion hosting plus a free domain.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.