How to Insert Relative Image URLs in WordPress

How to Insert Relative Image URLs in WordPress

Moving your WordPress site to another domain can cause all your image links to break. The same thing will happen when you move from a test to a production environment. This is caused due to WordPress using absolute URLs by default. Here’s a simple piece of code that will force WordPress to use relative URLs in the visual editor instead!

Disclosure: We receive a compensation from some of the companies whose products or services are presented on our website.