microtuts

WordPress: Change Absolute Image Paths (Fast!)

When migrating a WordPress site you may notice that images still point back to the previous server (or localhost).  Even if you go into the Settings or database and change the site_url you’ll still find post images pointing back to their original location.  You may also notice that certain theme and plugin setting retain the old absolute URLs as well.

I like to handle this by doing a search and replace in the database using WP-CLI (WordPress Command Line).  The command looks like this:

(run this from within the WordPress directory)

There are also plugins that can do this for you if you’re not into the command-line.  Google “wordpress database search replace” and find a popular, well rated one.


Creating your first programming language is easier than you think.

Understanding how a programming language works is a surefire way to be a better developer. Read more.


Suggested Reading


written by Ryan Bosinger
Ryan is a web developer living and working in Banff Alberta. He also writes for giftsforpeoplewitheverything.com and freefoley.com.

Leave a Reply