Make Paths Relative

Plugin Banner

Make Paths Relative

by Sami Ahmed Siddiqui

Download
Description

This powerful plugin simplifies website maintenance by automatically converting absolute paths (URLs) for resources like links, scripts, stylesheets, and images to relative paths. This ensures your website functions flawlessly regardless of its location on a server or domain.

Enhanced Efficiency and Flexibility

  • Seamless Relocation: Move your website with confidence, knowing all paths will adjust accordingly, preventing broken links and preserving a seamless user – experience.
  • Centralized Control: Update paths once in a central location, eliminating the need for tedious, site-wide modifications.
  • Potential Performance Boost: Relative paths can, in some cases, improve website loading times.

Whitelist Your Domains (Optional)

For extra control, you can specify a list of domains that will always be converted to relative paths. This ensures internal links are always optimized while allowing external resources to function properly.

Embrace a Streamlined Approach

This plugin empowers you to focus on creating exceptional content while eliminating the burden of managing absolute paths. Take control, optimize your workflow, and ensure your website’s continued success!

Filters

If you want to make plugin works and all the paths relative without going to check/visit Settings Page so, just add this line in your theme’s functions.php.

add_filter( 'make_paths_relative_activate_all', '__return_true' );

Note: Make sure to check the settings Page.

Bug reports

Bug reports for Make Paths Relative are welcomed on GitHub. Please note GitHub is not a support forum, and issues that aren’t properly qualified as bugs will be closed.

This process defines you the steps to follow either you are installing through WordPress or Manually from FTP.

From within WordPress

  1. Visit ‘Plugins > Add New’
  2. Search for Make Paths Relative
  3. Activate Make Paths Relative from your Plugins page.
  4. Go to “after activation” below.

Manually

  1. Upload the make-paths-relative folder to the /wp-content/plugins/ directory
  2. Activate Make Paths Relative through the ‘Plugins’ menu in WordPress
  3. Go to “after activation” below.

After activation

  1. Go to the plugin settings page and set up the plugin for your site.
  2. You’re done!

Does the trick, many thanks!

By tudorilisoi on July 31, 2025

it makes local dev to deploy frictionless

Breaks Database Connection

By KJ (kennjordan) on July 8, 2022

I have a clean WordPress install using the Twenty Twenty-Two Version: 1.2 theme. The only plugin installed is yours, 'Make Paths Relative'. In settings I checked the box for 'Image Paths'. Then changed the WordPress > Settings > General > Timezone from 'London' to 'Los Angeles' Then BOOM! the following error appears: One or more database tables are unavailable. The database may need to be repaired. Upon investigation in myPHPAdmin we discovered that the _options table field 'option_name' > 'siteurl' and 'home' were blank where the websites url should be. Once, we manually put in the URL into these fields, went back to the site, and refreshed; it worked again until we changed the timezone back again. We also tested this on different web hosts, servers, and with different themes and were able to reproduce the behaviour.

Not working

By tsf999 on December 23, 2021

Not working with WP 5.8, broke site completely while links are still absolute.

Excellente.

By Mauricio Lopez Coria (damonh) on March 22, 2021

Lightweight, easy to use, and it works. One of my must-have plugins.

simple, straightforward, works perfectly

By vor23 on June 22, 2020

This is just the perfect plugin: I installed it, easily set it the way I want it, then refreshed my site and immediately saw the results. If only all plugins were this straightforward, quick, and effective!

It caused trouble

By Fabr?cio (fabricio.s) on October 31, 2019

I didn't like the plugin. While enabled, it broke internal site links. Both http and https gave "too many redirects" error. Also, the tools to share on Twitter, Facebook, etc. gave error because the URL appeared relative (without the site domain). Just disable the plugin for both problems to end. I do not recommend.

Simple, useful, and well maintained

By alban74 on August 24, 2019

This plug-in has been very useful for me, as I am using Pantheon hosting and their Dev, Test, Live workflow. Making all paths relative helped to simplify everything and avoided an environment referring to links or assets from another as deployments go upstream. I ever had a small conflict with Yoast that would make the paths in sitemaps relative when MPR was activated, but a simple issue report to the plugin author, who has been reactive, helped fix this issue. Thanks again for providing this plug-in

Not production ready

By photocurio on March 29, 2019

This plugin is pretty good. For some installations it does not work. For example, a sub directory multisite environment will not work correctly. And many dynamic URLs output from get_template_directory_uri() still have absolute URLS.

Bloody marvellous!

By Big Frank on June 8, 2018

I've just bought a SSL certificate for our site and of course was getting mixed content errors because of those blasted absolute paths. I used a couple of search and replace plugins that caught some but by no means all of the absolute paths, I also wrangled with phpMyAdmin's laborious search and replace functions and finally I happened on this plugin and, frankly... YOU GUYS ROCK! I tested three images that had steadfastly refused to change their paths (mostly WooCommerce category images and images placed in widgets) and your plugin caught them all. THANK YOU!!! 🙂

Excellent Support

By gcurtisdep on May 25, 2018

Works great and very rapid and professional support when we had to track down a bug. I would recommend this plugin to anyone.

2.1.0 – July 11, 2024

  • Bugs:
    • Fixed an issue where replacements using \n or $n weren’t working correctly.
  • Feature Additions:
    • You can now include slashes in hostnames, giving you more flexibility.
    • For improved security, plugin can no longer be used on the admin dashboard.
    • We’ve enhanced how relative escaped URLs are handled within the body content.
    • Add functionality to relative WordPress stylesheet directory URIs.

2.0.0 – June 28, 2024

  • Security Enhancement:
    • Implemented a nonce mechanism to safeguard page updates, preventing unauthorized modifications.
  • Feature Additions:
    • Define multiple domains to be act as relative.
    • Enhanced content control by allowing removal of specific domains from the entire HTML body tag.

Earlier versions

  • For the changelog of earlier versions, please refer to the separate changelog.txt file.
Back to top