Updated info at bottom of post
As the title suggests, a recent post with a comma in the title and the resulting URL did not strip that comma out.
In most places this doesn’t seem to be an issue, but I was running a performance test yesterday and that made me take a look at the URL, which is when I noticed the comma.
For reference, the performance test is https://www.websitecarbon.com/ asks for the URL and then provides a general grade for the “greenness” of the page based on some set of criteria for carbon footprint of your webpage.
It flagged the URL, as seen in this screenshot, and I can only assume it is the comma.
This post with the URL not getting stripped is odd because it is part of a series that all have a comma in the title and this appears to be the only one that didn’t get stripped. I also have a very long series (six posts) that all have a comma in the title and they all got stripped from the URL.
So, I guess this is more of a question of why do you think it happened? can it be fixed and I could perhaps use the URL mapping to resolve sending it to a different URL, etc. Any ideas appreciated.
Edit: this is happening on today’s post as well, so now I wonder if something changed in the last two days with URL processing? Here’s the two URLs w/ the commas:
(^please note these won’t work anymore because I added a hardcoded Location without the special characters)
Oh, dear! It looks like all the posts now with a comma in the title where the URL originally didn’t have a comma now do and the previous URLs are 404-ing
^ignore that, it looks like the post in question also had the comma in the URL, so there are three total, I just didn’t notice the third one until just now, added to list above
LOL no, I was right, it wasn’t there before. It seems that if I edit one of these posts with a comma in the title, the previous URL without the comma gets changed to have the comma and then the old URL which I have linked elsewhere, because it is a series, returns a 404. Eek not sure what to do here.
Sorry to keep adding on here, in addition to the commas, there are also ampersands in the URL. I’m going to stop for tonight, but I think this might be a bigger issue with both commas and ampersands not getting stripped. So as long as I don’t edit anything else, it is just the three URLs listed above, two of which have both the commas and ampersands, one has just a comma because there is no ampersand in the title.
FINAL UPDATE for tonight (I think): my workaround for now is to add the “Location” front-matter and make it the URL is should be or previously was without the comma and ampersand, that way I won’t be sending people to 404s if they navigate between series posts. I also added a new URL map for one of the “wrong” URLs with the special characters to point to the “correct” version without the special characters because I know that post was getting traffic (thanks to Tinylytics) and I’d hate to have changed it and have a bunch of people hit a 404. Though I’ll now have a weird hit/Kudos mismatch, but oh well, better than 404s.