How to Find & Replace Links in a WordPress Site

 

wordpress find & replace links

Find and replace links in WordPress

If you’d like to learn how to build a professional blog or site using WordPress, we run regular WordPress Training and Advanced WordPress Training in Brighton, Sussex . We also run a great 1-day Blogging Workshop.

OK – so you’ve built a killer blog using WordPress, and there’s loads of great articles and tips on there that link back to your site, driving loads of useful traffic.

And then – BLAM – one of your web developers changes your site structure, the URLs change and all of your links are broken. Aaaaargh!

OK – so you can solve it with a 301 redirect – but the best link juice comes from direct links to the correct URL – so you need to find and replace all the links in your WordPress site.

Suprisingly, WordPress doesn’t have a built in Find and Replace feature – so finding and reaplacing all of the links in your post is going to take aaaaaages – right?!

Wrong! All WordPress sites use a MySQL database as their back-end. So – if you can get at that database via phpMyAdmin (if you ask your web host they’ll tell you how), you can update all of the URLs in the whole blog (or any other text for that matter) using a simple command.

Here’s how…

How to Find and Replace all URLs in a WordPress Blog

1. Log in to phpMyAdmin and select your WordPress blog’s database from the drop-down:

wordpress find and replace links

2. Now pick the SQL tab from the top of the screen:

wordpress find and replace links

3. You’ll now see a big empty box where you can add SQL commands. Carefully copy and paste the command below in to the box, and replace http://oldurl.com and  http://oldurl.com with the actual links you want to find and replace

UPDATE wp_posts SET post_content = REPLACE (post_content, ‘http://oldurl.com’, ‘http://newurl.com’);

Wordpress Find Replace Links

4. Now just hit the “Go” button to run the command, and hey-presto – you’ve replaced all of the links in your whole WordPress blog with the correct URL – that’s just saved you about an hour of trudging through all your posts one by one!!

Don’t forget to check out our WordPress Training Courses if you want to get to grips fully with WordPress.

Similar posts you may like

  1. How Do I Get Links to My Site? Use Your Social Media Linkerati – A 3 Step Guide
  2. Writing a WordPress Blog Post: 8 Top Tips
  3. Advanced WordPress Training for Custom Themes Now Available
  4. WordPress SEO – 10 top tips
  5. What’s new in WordPress 3.0?

Tags

, , , , , , , , , ,

Share This Post

Bookmark and Share

2 Responses to “How to Find & Replace Links in a WordPress Site”

Tweets that mention How to Find & Replace Links in a Wordpress Site « Silicon Beach Training Blog -- Topsy.com says:

[...] This post was mentioned on Twitter by heather buckley, Colin Welch and Silicon Beach, Notionline. Notionline said: How to Find & Replace Links in a WordPress Site http://bit.ly/9gRfqZ Fuente: @sbttraining [...]

Colin Welch says:

No problem – glad you found it useful

Leave a Reply

 

Follow Silicon Beach Training

Join uson


Silicon Beach Training


4.9 stars4.9/5 stars
Based on 23 reviews
See independent Google Places, Free Index and Qype reviews

Upcoming courses

See all course dates »

Home | Sitemap | Print |