Knowing how WordPress creates it’s own URLs may not be essential to know for general use, but it does give you an edge in understanding how it manages content.
As a starter, note that as a database, all items in WordPress- posts, pages, uploaded media, categories, tags, all are tracked in the database by a unique number identifier, or a database ID. And this is the way it actually determines from a web address what to show you.
For example, the WordPress Page for Week 6 of domain camp pretty much helps you know something about the content from it’s web address, https://extend-domains.ecampusontario.ca/camp/week-6/. But that’s not how WordPress sees the request; it’s actually:
Where 3677 is the database ID for that page.
Because these kinds of URLs are cryptic, WordPress offers tools to make them more human readable. And we can design how they are constructed via the WordPress settings for Permalinks. In your own WordPress site’s dashboard, look under Settings -> Permalinks. Here is where you can choose what structure WordPress can use to make more human URLs for your site. Here is what this interface looks like for the Extend Labs WordPress blog:
WordPress offers a number of permalink structures that are commonly used; Plain is the actual form that WordPress sees. Most commonly, the structure used has parts to indicate the date when it was published, e.g. this URL from CogDogBlog
shows that the post was written in April 2009 and also you can guess it has something to do about hashtags. Other formats in the Permalink settings create URLs that have no indicators of the date, they just use a form based on the post title -it converts all words to lower case, removes punctuation, and replaces all spaces with hyphens.
WordPress creates that link just from your blog post title; the problem is if you write a really long title, you get a long URL. So when the Mad Scientists at Extend Labs write a post titled “That Thing That Happens in the Lab When You Mix The Wrong Elements Together and People are Watching” they could end up with a giant URL if they use a Permalink format that uses the post title to create the URL:
If you are aware of that, while editing the post, you will notice you can edit the Permalink it creates by default. The Mad Scientists could manually make it shorter by clicking that Edit button next to the Permalink/
and create a more digestable URL, such as
The Permalink settings allow you to create custom formats, that could, as the scientists did, include a number to represent the year as well as using the post database ID rather than the title text, in the URL. See what they did to make published links like:
Experiment with your own blog to find a Permalink structure that appeals to you. Save the Permalink settings, then write a blog post that explains your choice, and use its URL as a response to this challenge.
Understanding permalinks will also come into play when you create Categories– this is the “slug” setting you can use to create shorter links for long category names.
Example for "Wrangling WordPress Permalinks":