Change database image location for transportability

The problem: the worpress site is developed locally by my team. When we finish, we will put it online. Now, changing the siteurl, home and ossdl_off_cdn_url in the database table wp_optionsis easy to change. But we have to change all URL in post data, especially the links that lead to the images.

We want, when we post a new image, that is registered in the database by:

<img src="/wp-content/etc/....

And not:

<img src="http://siteurl/wp-content/etc/....

There is a plugin or a mod to do so?

We have already ran this query:

UPDATE wp_posts SET `post_content` = REPLACE (`post_content`, 'src="http://siteurl', 'src="');

To cancel all reference URL and get image directly from the site root folder /wp-content but we do not want to do this also for future images.

Read more here: Change database image location for transportability

Leave a Reply

Your email address will not be published. Required fields are marked *