Version: 13.1c
Revision: 23 Build 11
Wordpress – Stitch those broken images with SQL query!
Introduction: In the middle of the project, my hard drive is in a big mess.
I really do need some time to sort my applications and everything else, in proper orders. But, for now, my readers are waiting and they are ready for another tutorial!
This tutorial is rather small and it’s about repairing your broken – post’s images. But, don’t just say that, it’s easy! From here, you’ll be controlling your SQL database and your ‘Wordpress’ images (uploaded media). So, before you try this tutorial, please create a backup of your ‘Wordpress’ database. After that, you can proceed and repair your broken images!
1.] Login to your Cpanel and select phpMyAdmin.
2.] Wait for the dialogue box and click on your SQL icon.
Facts: this icon is called: SQL query command. It is located on the top – left – corner, which is next to a little house icon (Home).
3.] Copy this code and paste the following code into the “SQL command” window.
UPDATE wp_posts SET post_content = replace(post_content, 'old-domain.com/wp-content/uploads/', 'new-domain.com/wp-content/uploads/');
4.] Let it run and complete its task. After that, you can check your domain for any broken images.
5.] You’re Done!
Notes: if the above doesn’t work. You can try this method…
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
Tips: to easily change your domain name, you must use MySQL functions: “replace,” which enable you to replace a single term by another.
Copyrighted By Lair360







