How to create a custom permalink structure for your WordPress site

How to create a custom permalink structure for your WordPress site

Will Morris's Layout avatar

Your site’s permalinks are more important than you may realize. Far from being a seemingly arbitrary set of characters that direct to your site’s pages, how you structure your permalinks can have an effect on how well your site ranks in search engines. This also affects your click-through rate (CTR).

Given this, WordPress provides you with several pre-configured permalink structures you can choose for your site. However, it also enables you to customize your permalinks by creating your own custom structures. This can be particularly handy if you find the default options unsuitable.

In this article, I’ll explain what custom permalink structures are. I’ll also walk you through the process of creating them, and provide advice for how to settle on the most effective structure. Let’s go!

female flywheeler at desk working on permalink structure in WordPress Meet Elizabeth, one of Flywheel’s technical account managers!

An introduction to permalink structures

Simply put, a permalink is the unique URL used to access each individual part of any website. It’s what you enter into the address bar to access the site, or include in posts or emails when you want to share a post with others.

To illustrate, consider that the permalink to Flywheel’s home page is https://getflywheel.com. In contrast, the permalink for a specific post on Layout looks like: https://getflywheel.com/layout/sidebar-endangered-species/.

In this case, the permalink is made out of a few main components: the domain name (getflywheel.com), a category (layout), followed by the slug (sidebar-endangered-species). When talking about permalink structures, it’s the two latter parts you want to focus on. This is essentially how you structure, categorize, and label your posts.

WordPress users can easily set a site’s permalink structure – in your Settings screen, you’ll find a selection of default options:

custom permalink structure preset settings in WordPress I’m using Local by Flywheel to make changes without breaking a live site!

When you first install WordPress, the Plain option will be set by default, which will create permalinks using each page’s unique ID number. However, you should always change this, as this structure is hugely lacking.

While it might seem like a minor concern, it’s actually quite important to use a permalink structure that works best for your site and its content. If you’re using permalinks that are long, difficult to remember, or don’t accurately convey each page’s content, your pages could be less visible in search results. Users could also be less willing to click links if the URL looks messy or doesn’t include information about the page’s content.

The Plain structure falls into several of these traps, so choosing another structure is usually a paramount step. However, even with these default options, you might still want to structure your permalinks differently. Fortunately, WordPress makes this just as easy.

Why you might use a custom permalink structure

Rather than just sticking with WordPress’ default permalink options, you may find that creating your own custom permalink structure is best. WordPress enables you to do this by specifying various structure tags. I’ll discuss these in more detail later on when we look at how to actually create your own permalink structure.

female flywheeler at desk working on permalink structure in WordPress

Of course, there’s no perfect permalink structure, and what you decide to use is entirely up to you. Different sites have different goals and purposes, after all. However, there are some things you should take into consideration when you create your permalink structure:

  • Whether or not to include dates. While it can sometimes be handy to include date information in your links, it can also make the content seem old. If somebody comes across a post of yours using a search engine, but notices it was posted several years ago, they’re much more likely to find a more recent alternative.
  • Avoid post IDs. I already mentioned this earlier, but it bears repeating. Including unclear and ambiguous data in URLs has no benefit, as it won’t help you organize your posts better, nor will it give users any idea of the content. As you can imagine, this also affects your Search Engine Optimization (SEO).
  • Make them as short as possible. The shorter your permalinks, the easier they are to remember and share. This is a big reason why you may want to avoid including categories and tags as part of your permalinks. The link yoursite.com/blog-post is infinitely more memorable and readable than yoursite.com/blog/news-updates/2018/08/31/blog-post, for example.

One important thing to remember before you proceed is that you should avoid changing the permalink structure if you already have a considerable amount of content on your site. Naturally, this is because changing every URL on the site may lead to many broken links. Permalinks are meant to be permanent, after all.

However, if you do wish to change your permalinks after the fact, you will need to redirect the original links to their new URLs. This can be a relatively involved process, so be absolutely sure you’re ready to proceed before you make any changes.

Want to test this tutorial without changing your live site? Try Local by Flywheel and work on your sites anytime, anywhere!

How to create a custom permalink structure for your WordPress website

Let’s now take a look at how to set your site’s permalink structure, and how to create your own custom variation. As I mentioned earlier, WordPress makes this process very easy, so start by accessing your site’s admin dashboard and navigating to Settings > Permalinks:

custom permalink structure WordPress dashboard screenshot

Here you’ll see the different default permalink options. However, we’re primarily interested in the field underneath them:

custom structure settings in wordpress dashboard when creating a customer permalink structure with date and post name

To construct your permalink format, you’ll be using structure tags, which I touched on briefly in the previous section. These represent different properties of a post. There are various types you can use to include the post’s title, the date when the post was published, a category, and even the name of the post’s author.

For example, if you wanted to include the year and the post title, you would use the following structure:

/%year%/%postname%/

This would render permalinks that look as follows:

https://yoursite.com/2018/the-title-of-this-post/

All you need to do to build your structure is to click the buttons underneath text field. This adds the selected tag to the current structure. For example, here I’ve clicked %postname%:

custom structure settings in wordpress dashboard when creating a customer permalink structure set to post name

All you need to do is add the tags you require until you’ve completed your custom structure. For this example, I’ll use the post’s author and title in the permalinks, which requires the following tag structure:

/%author%/%postname%/

When you’ve finished, click Save changes to apply your new permalink structure. You will be able to see the effect immediately in all your URLs.

For example, let’s say we started out using the following permalink structure:

/%year%/%monthnum%/%day%/%postname%/

This would have made our permalinks look like this:

custom structure settings in wordpress dashboard when creating a customer permalink structure set to date and post name view from post tab in dashboard

However, now we’ve changed it, you can see the difference just by accessing or editing a post:

custom structure settings in wordpress dashboard when creating a customer permalink structure set to post name view from post tab in dashboard

This means you’ve successfully created and applied a custom permalink structure on your site!

Conclusion

Taking a moment to consider your site’s permalink structure is not time wasted. In fact, by settling on a simple structure containing the most important information, you can improve your SEO and make your links more trustworthy and clickable.

Fortunately, WordPress makes it easy to configure your permalinks. While you could stick with the default options, you can just as well create your own customized permalink structure. This gives you total control over how your links look, both when shared and in search engines.

Do you have any questions about what makes a good permalink structure? Let me know in the comments section below!

Comments ( 4 )

  1. Kathir

    September 29, 2018

    Thanks for awesome guide, i am looking to create custom permalink structure, i tried this and ut works fine.
    Regards,
    Kathir.

  2. TomJones

    September 30, 2018

    wow

  3. The Thus

    February 14, 2019

    Hello,
    I have setup and configured as you shown in article but still my articles are ranking in Google like domain.com/category may I know how to selve this issue ??

  4. Tommy Vitikka

    May 16, 2019

    Hi. As Flywheel is using nginx, htaccess hacks doesn't work. I want this structure to work: /%category%/%postname%/
    So I can go to the posts root with /%category%/. There's no way to accomplish this as far as I see. Doing the hack of "." on the category prefix makes the category-url 404.

    My category is called news (and is wpml multilingual). This is what I want:
    mysite.com/news/
    mysite.com/news/mypostname/

    mysite.com/someothercategory/
    mysite.com/someothercategory/somepost/

    Any ideas?

    Now I'm actually giving up and will create a page called news and that one will populate a list of news with pagination etc. Then I'll create a fixed prefix for categories called "News" (I actually have only this category) and translate that.

    • Author
      Morgan Smith

      May 16, 2019

      Hey Tommy! Our support team would love to look at that a little closer. If you submit a ticket here, they'll be in touch soon so we can try to get that fixed up!

Join the discussion