May
May

How to Use PHPMyAdmin Find and Replace in Your Database

How to do PHPMyAdmin Find and Replace?

Find and replace is an awesome concept. I use find & replace every day in different forms – documents, my text-editor, etc. but one that I use all the time is to run a find & replace query in the PHPMyAdmin of MySQL databases.

I use this regularly to clean up WordPress databases that I’ve migrated to my hosting serviceupdate [table_name] set [field_name] = replace([field_name],'[string_to_find]’,'[string_to_replace]’);

Here is what it means for WordPress users:

  • [table_name] – This is the name of the table that you’re wanting to update and along with…
  • [field_name] – This first instance of the field name tells MySQL where to make the update and where you’re looking for that bit of info to reside
  • [field_name] – This is the second instance of the field name, where you’re telling the function to find it, and this is the place that you want to make the change
  • [string to find] – This is the specific text that you are looking to remove
  • [string to replace] – This is what you want to add in its place

Just make sure that you remove the brackets, those are there to make it a little easier to read and understand. See, it’s not so bad!

Here is what an example would look like

In this example I’m looking to replace all instances of the word “capital” a financial term, with “capitol” a term related to a place where a legislative body meets. I want this change to be made in the body content on all posts and pages so the table_name will be wp_posts and the field name would be post_content.

My statement would look like this:

update wp_posts set post_content = replace(post_content, 'capital','capitol');

All you have to do is hit “go” and PHPMyAdmin will take care of the rest.

A couple things to keep in mind:

  • There is no “undo”. Make sure your statement is accurate. Otherwise, you’ll be doing a find and replace for the mistake you just made.
  • Tread carefully. This is your database, and it assumes, that if you’re in here you have at least some sort of idea as to what you’re doing.
  • Changes are immediate. No waiting for caches to refresh (unless you’re using some sort of caching system). Your changes should be immediately visible.

I hope that helps! I use find and replace all the time and having this tool available to you will make your edits and changes much easier.

See Also:

Do I have to use WordPress to start a blog?

Jun

"You don’t have to use WordPress to start a blog. WordPress is the industry-standard for good reason, but it’s not the only choice. There are a lot of alternatives to WordPress if you want to try something else. But keep this in mind: When it comes to finding advice about growing your blog and scaling […]"

Keep Reading...

Do I Need To Hire A Website Designer?

Apr

"The story goes a little something like this: A mastermind group was meeting and they were going around the table talking about the projects they were working on and the progress they were making. One of the members was talking about his project and how he was trudging along making progress and started to talk […]"

Keep Reading...

Answered: Your Most Burning Questions About Starting Your First Website With WordPress

May

"Remember the Konami cheat code? Up, up, down, down, left, right, left, right, B, A. That code was the golden ring for gamers. It unlocked untold riches in the gaming world – “god” mode, virtually limitless power-ups, or an endless supply of ammunition to make your way through to the end. The cheat code offered […]"

Keep Reading...

Is ClickFunnels Good For SEO?

Jan

"It’s easy to think that with ClickFunnels being such a robust marketing platform that it solves all your marketing challenges easily, so it’s natural to ask “is ClickFunnel Good for SEO?” The short answer is no, ClickFunnels isn’t good for SEO. ClickFunnels does a lot of things very well, but it’s not a platform that’s […]"

Keep Reading...

What is an online sales funnel?

Jan

"If all this talk about sales funnels is new to you, then let’s stop talking about ClickFunnels for just a minute so we can cover that. If you’re in to online business at all I’m sure you’ve heard the term “sales funnel” thrown around by some of the big names in the space – it’s not all that uncommon. […]"

Keep Reading...

Creating Pages With WordPress | How To Make A WordPress Blog Step-by-Step 2020

Feb

"How To Create Static Pages With WordPress Welcome to the Mastering Essentials of WordPress series where we’re walking through the various features and functions of your new self-hosted WordPress site so that you are fully up to speed on everything you need to do and every tool that you have at your disposal to make […]"

Keep Reading...

How To Set Up The Social Warfare Plugin | How To Make A WordPress Blog Step-by-Step 2020

Mar

" The Social Warfare Plugin for WordPress is a great tool to provide your users a way to engage with your content on your WordPress site. Because we don’t want to just feel like we’re shouting out in to the void, right? We spend the time to create what we believe is great content and […]"

Keep Reading...

One Funnel Away Challenge Honest Review 2022

Mar

"So, you’ve been hearing about The One Funnel Away Challenge and you want to see if it’s for you? As someone who’s completed the One Funnel Away Challenge, I’ve got you covered. I’m going to cover everything you need to know about The One Funnel Away Challenge and its updated version that was just released […]"

Keep Reading...

How to Generate Leads For Realtors in 2021

Apr

"How to generate leads for realtors The real estate market is absolutely on fire in 2021! So, as a realtor, how do you tap into this market? And an even better question is, how are you going to make sure your sales funnel stays funnel if and when things cool off? Having a constant source […]"

Keep Reading...

How To Set Up Wordfence | How To Make A WordPress Blog Step-by-Step 2020

Mar

"Outside of driving traffic to your website security is probably one of the biggest concerns of all WordPress website owners, so in this video I’m going to show you how to set up WordFence – one of the top plugins for securing your self-hosted WordPress site. The problem is that, because of how easy it […]"

Keep Reading...