How can i make all my links in joomla including menu items and article links absolute links and not relative ones? and of course, without hacking the core files.

migrated from stackoverflow.com Jul 11 '14 at 11:47

This question came from our site for professional and enthusiast programmers.

  • 6
    Why would you want to do this? It simply makes life so much harder and if you ever decide to move you site to a new host, you will have to update every link – Lodder Jul 8 '14 at 19:23
  • You do realise this might affect your load times and cause the host to break out from internal routing? – Anriëtte Myburgh Oct 27 '15 at 13:18

The best way is probably to create a plug-in on the onContentPrepare event which does a search-and-replace on any links.

What is the reason you are wanting to do this, though? You have tagged this SEO, but any argument I have seen for absolute links over relative links would be countered by Joomla's use of the base tag. The rest seems to be all hearsay, and it is bad development practise.

If you are worried about broken links, run a broken link checker. Absolute links are just as likely to break.


I know you said you do not want to 'hack the core files' but Joomla comes with all these great module/theme overrides that let you customise their output without loosing these changes each time you run Joomla updates. All you need is an FTP program and a text editor. It does involve customising your theme but the core files are left alone.

Absolute Menu Links

To make all menu links output an absolute url I can show you what worked for myself.

A related question that helped point me in the right direction can be found here: How to make a template overwrite for mod_menu with alternative layouts.

If I want to change how my links are output I can copy the default_component.php to my theme's directory and change it e.g.





It is easy to change the 3 cases at the bottom for the 3 standard links types.

From here clear your cache and test. You should now have absolute urls in your menu items.

Absolute Article Links

Depending on the size of your site this could be easy or tedious. Ask all content editors to use absolute urls when creating/linking to content. You could use a db utility by NoNumber to search and replace in your database but always remember to take a backup first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.