Disclaimer: this is how it currently works; I offer no guarantees that this information is valid in your epoch!
The only constant is change.Heraclitus (c.535 BC – c.474 BC)
Each WordPress post is allocated a permalink (short for ‘permanent link’), a URL (‘web address’) that needs to remain the same after publication. It has to be permanent, or the web would simply unravel.
Importantly, a permalink is generated when a post is scheduled for publication in advance — and this feature enables time travel. Well, hyperbolically, anyway (yep, my post title was clickbait; sorry about that 😅, hope you forgive me — and if not, thanks for coming and enjoy your day!).
Time travel into the past
That’s easy; we do it every time we follow a link to a published post.
Time travel into the future
This may seem like a bit of a digression, but bear with me, please; there is method in my madness. Well, I think there is.
Regular visitors to Wibble may have noticed that I’m a fan of The Hitchhiker’s Guide to the Galaxy by the late, great Douglas Adams. As such, along with a great host of fellow-minded lunatics, I celebrate Towel Day each year on the 25th of May. For last year’s festivities, I composed a trivia quiz, one that was so well-received that I was encouraged to create another one for 2021. And another for 2022. And, yes, I got carried away, and made one for 2023, too.
Naturally enough, I wanted to ensure that I didn’t forget about these posts. It would be all too easy to lose them in the quagmire of my WordPress drafts. And so, even though the dates were far off in the future, I scheduled them for publication. They will go live on their respective dates, even if I get run over by a bus (assuming that WordPress is still around, naturally — hopefully that’s not an issue).
The point is that, when you schedule a post, WordPress offers the option to copy its permalink, enabling you to refer to it in advance. This is the link to the Towel Day 2021 quiz — if your ‘now’ is before 25May2021, don’t bother clicking that link as the post is not yet live; it will present you with a ‘404 error’§. I shared that link with the froods at towelday.org, and they were hoopy enough to put it on their website — and because of that, if I make any changes to that post, I have to be careful not to upset its permalink. Because, as it turns out, the ‘perma’ part isn’t so permanent after all….
The not-so-permanent permalink
The construction of a permalink is pretty standard. It’s composed of various parts:
- [domain name] is, well, it’s the domain name, innit?
- year, month and day (YYYY, MM, DD) are the publication date
- [slug] is based on the post title (with spaces replaced by hyphens, and characters that aren’t legal in a URL removed)
The final permalink is allocated when the post is published. Although it is possible to change this, doing so would be unwise as you never know who, or what, may have linked to it. The WordPress Reader, for instance, is probably one of the first things to grab and use a link to a published post.
Before publication, a temporary permalink is generated while the post is being developed; and, importantly, this permalink can change.
While the post is in draft (and before it has been scheduled), the slug changes dynamically to reflect the current title.
When a post is scheduled, the slug part (only) of the permalink lives up to its name: it becomes fixed. It will no longer change dynamically, so if the title is altered it may be necessary to consider amending the slug (which then changes the permalink) to match. This is true even if you revert the post to draft. I believe this behaviour may be a bug (sorry, I mean ‘feature’), as the date portion of the permalink does still change to reflect alterations to the publication date, even on a draft that was previously scheduled.
When a draft is manually saved (by hitting the ‘Save draft’ link in the editor), any changes to the publication date (year, month, day) are reflected in the current permalink. Note that autosave doesn’t appear to do this every time (though I could be wrong about that).
It’s an unlikely scenario (one I haven’t tested), but I suspect that if the domain name were to change between scheduling and publication, the post’s URL wouldn’t reflect this change. For example, if I were to register the name ‘wibble.blog’ again, and set it as the main site address as I once did (I explained the reason why I reversed this in an earlier post), the permalink of this post would, I think, retain ‘pendantry.wordpress.com’ as the domain name.
§ A caveat: Usefully — but also confusingly if you’re not aware of it — WordPress provides the illusion of being able to actually ‘visit’ a post that’s scheduled for publication in the future; it doesn’t report a ‘404 error’ iff the post is on your account and you’re currently logged in. The Towel Day 2021 quiz post appears, for me, in my browser as though it’s live — even though there are still (currently) 91 days to go: