Make Paths Relative

Descrição

This plugin can make(convert) the paths(URLs) to relative instead of absolute. This plugin is useful to using the relative URLs. The given below list of permalinks and src can be easily converted to relative:

  • Post Permalinks
  • Archive Permalinks
  • Author Permalinks
  • Term Permalinks
  • Scripts Paths(src)
  • Styles Paths(src)
  • Image Paths(src)

All the above permalinks and src can be converted to relative instead absolute by using this plugin. You can select the options from the plugin settings page.

Filters

If you want to exclude some Permalink or src to be relative so, you can use paths_relative filter in your theme’s functions.php or in your custom plugin.

Your filter may looks like this (Below filter would make the jquery.js Path to absolute):

function yasglobal_change_path( $link ) {
  if( $link == '/wp-includes/js/jquery/jquery.js?ver=1.12.4' ) {
    $link = site_url().'/wp-includes/js/jquery/jquery.js?ver=1.12.4';
  }
  return $link;
}
add_filter( 'paths_relative', 'yasglobal_change_path' );

If you doesn’t want to Make the Paths relative for srcset(Responsive Images)
so, just add this line in your theme’s functions.php.

add_filter( 'srcset_paths_relative', '__return_false' );

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' );

Make sure to check the settings Page

Thanks for the Support

The support from the users that love Make Paths Relative is huge. You can support Make Paths Relative future development and help to make it even better by donating or even giving a 5 star rating with a nice message to me 🙂

Donate to Make Paths Relative

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.

Instalação

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!

FAQ

Q. Why should I install this plugin?

A. Installing this plugin is the easiest way to make the paths(Permalinks + src) relative.

Q. May i select the paths which i want to be show as relative items?

A. Yes, You can select the items you want to be relative.

Q. May i exclude some items to be shown as absolute?

A. Yes, You can exclude the items by using the add_filter (You can find the filters in the Description Area ).

Avaliações

Bloody marvellous!

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

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

Good work

Although not solved all the problems, but saved a lot of time. Is it possible to make relative menu links using this plugin? (I did this via an additional filter).

Works Fine

Dear Sami Ahmed Siddiqui,

Thanks for making this Plugin. This plugin works fine as expected.

I wanted to create my WordPress website on another domain and link it to my main site under a subdirectory

I could easily create the relative URL, solving my worries.

The only thing is it doesn’t change the logo URL. Could you please help to solve that issue as well?

Leia todas as 7 avaliações

Contribuidores e desenvolvedores

“Make Paths Relative” é um software com código aberto. As seguintes pessoas contribuíram para este plugin.

Contribuidores

“Make Paths Relative” foi traduzido para 3 localidades. Obrigado aos tradutores por suas contribuições.

Traduzir “Make Paths Relative” para o seu idioma.

Interessado no desenvolvimento?

Navegue pelo código, dê uma olhada no repositório SVN ou assine o registro de desenvolvimento via RSS.

Registro de alterações

1.0.0 – Sept 26, 2018

  • Enhancements
    • Added Tags and Custom Taxonomy Support
    • Change priorities for the all the filters to enhance the URLs relative performance
    • Removed make-paths-relative-main.php dependency

0.6 – May 25, 2018

  • Enhancements

    • Added Privacy Policy Section which will be shown in Admin Dashboard for
      WordPress 4.9.6 or higher
  • Bug

    • Fixed redirect issue for media when it is attached to post.

0.5.7 – Jan 26, 2018

  • Update text domain on about page