Let’s say that you are creating an article called “Privacy Policy” on your Joomla website. You add the article to your website, and the article’s URL becomes like this (if you have SEF enabled):
http://www.yourjoomlawebsite.com/uncategorized/privacy-policy
As you can see, the name of the category, which is uncategorized, is automatically added to the URL of the article. Now you think a bit, and decide to add the article under a category called general, you check the link again and it’s something like:
http://www.yourjoomlawebsite.com/general/privacy-policy
Hmmm…. But you need to get rid of the category name from the URL altogether, whether it’s uncategorized, general, or any other category name. So you try to search for such a setting in Joomla’s configuration settings, but you find nothing. You then try to fiddle with your .htaccess file, but that doesn’t work either. Finally, your research the problem on Google, and you find that many other people have the same issue, and they have been, so far, unsuccessful in getting rid of that category name from the URL.
Now there are two ways to solve this problem, the easy way and the hard way.
The easy way consists of creating a category called “Privacy Policy”, adding the content of your current “Privacy Policy” article to the description of this category, deleting your “Privacy Policy” article, and finally creating a menu item that links directly to the category (the menu item must be of type Category Blog Layout). If you do this, your link will be as follows:
http://www.yourjoomlawebsite.com/privacy-policy
As you can see from the above, creating a category and pointing the menu item to a category instead of an article will solve the problem. The main advantage of this method is that is very fast and very efficient – the main disadvantage is that it can make your content disorganized (any staff member who wants to edit the privacy policy will be lost because he’ll not be able to find it in the Article Manager).
Now, the hard way is much more advanced and requires you to do the following:
- Modify Joomla’s SEF core files in order to remove the category name from the URL. (Note: There are several files that need to be changed.)
- Ensure that the change you’ve done above is accommodated in your .htaccess file.
- Ensure that you don’t break any functionality with this code change.
Needless to say, the above is really delicate and complicated to do (not to mention that it requires modification to Joomla’s core, which makes your website very challenging when it comes to upgrades), and we advise you to only do it if you have some very solid PHP programming skills or if you hire some Joomla experts to do it for you. In any case, we personally recommend you go with the first option, unless your website has a lot of data and a lot of categories.
Now If you need any help removing the category name from the URL, then you can just contact us. We’re always here for you, we are fast, we are friendly, we are fun to work with, we are courteous, and we don’t charge much!
[…] of the main reasons for this is SEF: By default, Joomla adds the category alias of the article to the URL. If Joomla allows you to assign your article to multiple categories, then which category alias […]
I think I will do the easy way, as you sugested. Thank you. This is exactly what I was looking for. But isn’t there a third way to remove the category from the URL? I mean, I can’t believe Joomla was built like that!