Managed Wordpress

How to Fix Image Links after a WordPress Migration?

To fix image links after a WordPress migration.

Steps to Correct Image Links After a Migration

Stpe1:-  Log into your cPanel account.

Step2:-  Go to the Databases section and click on the phpMyAdmin tool icon.

Step3:- The main phpMyAdmin page will open. Search for the newly added database, and click from the left sidebar on its name. The database name here is aaeotyee_wp231.

Step4:- With this the database opens and a list of the tables refreshes the screen. Go to the sidebar, and click the table of wp-posts.

Step5:- On the top of the screen, you will see several tabs running across the page. Click on the SQL tab.

Step6:- In the MySQL editor screen, go to the code area and copy the below bit of MySQL.

  • UPDATE wp_posts SET post_content=(REPLACE (post_content," "," "));

Ensure that you replace the old sitename with the new site name. For instance, your original site was milesweb.com, the new test site will be at test.milesweb.com so the code should appear as below:

  • UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘milesweb.com’,‘test. milesweb.com’));

To run the code and change the URLs for all images in the posts, click on the Go button. With this other, ‘hard coded’ links will also get affected that were in the posts that pointed to the original site.

 

Keyword Tags:-  Managed WordPress, WordPress Migration, WordPress.

 

From <https://www.milesweb.com/hosting-faqs/how-to-fix-image-links-after-a-wordpress-migration/>