Sometimes when you migrate your WordPress website you can face problems related to image links. You need to fix this issue otherwise, your visitors will not be able to properly see the images present on your site. To fix this issue follow the steps given below:
- First, log in to your cPanel using your account credentials.
- Then go to DATABASES > phpMyAdmin.
- Then search for the newly added database, then click on it.
- When you click on it a list of tables will appear. From the list of tables select wp-post.
- Click on the SQL tab which is present at the top bar.
- In the MySQL editor screen go to the code area and paste:
Inside the first quotation, write the domain name of your old site and inside the second quotation mark write the domain name of your new site. For example, I have changed the site domain name from 'abc.com' to 'def.com'. Then the code will look like below:UPDATE wp_posts SET post_content=(REPLACE (post_content," "," "));
UPDATE wp_posts SET post_content=(REPLACE (post_content,'abc.com','def.com'));
With this, your problem with the image link will be fixed.