I leaned something new yesterday. There’s this thing called a slug. I’m not talking about one of those slimy things that slowly slithers across the sidewalk leaving a filmy mucus trail behind it. Yuck.No, the slug I’m referring to is a tool that websites use to be accessed. URL slugs are the exact address of a specific webpage. It is the location where webpages are accessed when their URLs are typed in the address bar. It essentially is used to create a permalink for each post. WordPress automatically generates a post slug from the post’s title. For example, the slug for this post is “aptitude-for-attitude.”
So why is this important? Allow me to explain. You know I host a daily word challenge. Well, I’ll let you in on a secret. I generally create these posts about a week in advance and then schedule them to post at 12:01 am Pacific Time on the appropriate day. So far so good, right?
One of the posts I scheduled in advance was yesterday’s post, which was the word “attitude.” When I originally scheduled this post, it was for the word “aptitude.” But a few days ago, I decided to change the word to “attitude.” I changed the post’s title. I changed the word “aptitude” to “attitude” in the body of the post, and I also changed the tag to “attitude.”
What I failed to do was to look at the scheduled post’s slug. I mean who knows to check the slug? Turns out the slug said “fowc-with-fandango-aptitude,” even though I had changed the post’s title to “FOWC With Fandango — Attitude.”When I changed the title of the post, it did not also change the slug correspondingly. Remember earlier when I wrote “WordPress automatically generates post slugs from a post’s title”? Well, that apparently only happens the first time you either initially publish or schedule the post. If you change or update the post later*, it doesn’t update the slug.
And this apparently led to some confusion, as a few bloggers wrote their posts in response to the One-Word Challenge built around the word “aptitude “ and not “attitude.”
As soon as I saw this, I went back to the post and manually changed the slug to read “fowc-with-fandango-attitude.”
So if you have ever either scheduled a post and then change the post’s title before it’s published, or if you’ve published a post and change its title after it was published, be sure to check and update your slug.
*This is not the case with draft posts. If it’s a draft, when you change the title, the slug will also change. It’s only once the post has been scheduled or published that it doesn’t change the slug if you change the post’s title.