Better than a Permalink

Do not do any changes to your site until you read the full Post !

Everyone is aware of the permalinks capability of WordPress, but for sites with fully or partially hierarchical structure there is an additional feature which can make your site easier to navigate and understand.

The idea is for the hierarchical part of your site to use this hierarchy in building your permalink. For example the following page “Learn Java” based on the structure of this site the permalink can be :

  • learn-java
  • learn/java
  • learn-programming/java
  • learn/programming/java

It is clear that the last one is the superior link if you know that every word in this link represents a page.

  • learn
  • learn/programming/
  • learn/programming/java

Again I’m emphasizing that you do that only for the parts of the site that exhibit hierarchy.

So if all what I said apply to your case, how do you do it ?

There is an option in the side panel in the Block editor where you specify Parent page, but if are like me and learned about this after the fact then you would use the Quick edit in the Dashboard > Pages > All Pages list (like shown below) to do the modifications.

Set all the pages in the hierarchy in the following manner :

  • learn => no parent
  • learn/programming/ => learn
  • learn/programming/java => learn/programming/

Why do you see the yellow highlights ? Because there are several things to account for that you have to take into consideration.

First you want your Title to stay descriptive, so you may keep it as it is.

Second your slug should be shorter because it is now part of the hierarchy. You don’t want to put there learn-java, because your permalink will become learn/programming/learn-java. We don’t want that.

The third thing is that if this page is a part of a menu you may have a different text there because of a space constraint.

In this site I have even deeper hierarchy : /understand/programming/languages/java/
But as you see I have many sub-hierarchies, instead of ONE, because otherwise the URL will get too long.

So you like the idea and want to jump in … A, a, a … not so fast. Changing the structure of your site means broken links. So before you start find yourself a plugin to mop up after you break some eggs.

I used “Broken Link Checker“.

Now you are good to go ….