Replace all Occurrences of URL Globally in WordPress
When user redirect link to new address which is widely used inside multiple posts then changing each link is almost difficult in every post. Following tutorial will explain you how to replace every occurrence of URL using simple phpmyadmin query.
Problem Statement :
I need to change every occurrence of www.xyz.com with www.abc.com.
Solution : Change URL in Post Content Globally using phpMyAdmin
- Login to phpMyAdmin and select your database
- Click the SQL tab to write new fresh query on selected database.
- Enter the following in the run SQL Query text box -
- Click Go to process the changes and update your SQL database
1 2 3 4 5 6 |
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'http:<span style='color:#595979; '>//</span><span style='color:#5555dd; '>www.old-link.com</span><span style='color:#595979; '>', </span> 'http:<span style='color:#595979; '>//</span><span style='color:#5555dd; '>www.new-link.com</span><span style='color:#595979; '>'</span> )<span style='color:#308080; '>;</span> |
[box]
Kindly replace http://www.old-link.com and http://www.new-link.com with your actual information.[/box]