Can You Have Quotation Marks and Apostrophes (Single Quotes) in Your Permalink URL?

Can quotation marks (double quotes and single quotes) and apostrophes be included in your WordPress permalink URLs? I am not an authority on this, but I found a case recently where an apostrophe from a post title was being included in the permalink and it was causing the permalink to produce a “Page Not Found” 404 error. Removing the apostrophe from the permalink fixed the problem.

By the way, if you are looking for a solution to the problem of multiplying apostrophes and quotes in your WordPress posts, click here: How to Fix WordPress Multiple Apostrophe.

The example looked something like this. This is not the actual URL and title, but it did include “Montezuma’s Revenge”. Maybe that’s what the server found offensive! 😉

http://www.example.com/2009/blah-blah-montezuma’s-revenge-blah-blah/

The title of the post was “Blah Blah Montezuma’s Revenge Blah Blah” (without the double quotes).

As you probably know, you can put apostrophes and quote marks in post and page titles, but if your site is hosted on WordPress.com, those will be removed when WordPress creates the permalink URL. [UPDATE: No. Double quotes will not necessarily be removed, as you can see from the URL for a recent post on WordPress Security.]

The problem with an apostrophe in a URL happened on a self-hosted WordPress installation, and, as a matter of fact, it is installed on a Windows IIS server, rather than the usual Linux/Unix Apache server.

I’m not an expert at server issues, but I do know that sometimes things like this happen with WordPress only on Windows servers. For instance, when you enable permalinks on Windows, sometimes the URLs will include “index.php” – like http://www.example.com/index.php/2009/blah-blah-montezuma’s-revenge-blah-blah/ when this normally never shows up in a URL.

At any rate, when I used the Permalink Edit button (under the post/page title window in the WordPress Editor) to remove the apostrophe, the problem went away. The permalink URL now looks like: http://www.example.com/2009/blah-blah-montezumas-revenge-blah-blah/

Oddly enough, I can now get to the page from both URLs
http://www.example.com/2009/blah-blah-montezumas-revenge-blah-blah/
and
http://www.example.com/2009/blah-blah-montezuma’s-revenge-blah-blah/

No idea why that would be, but who cares since there’s no longer a 404 error.

Advertisements

8 Responses

  1. Hi Mark,
    Do you know if there are similar issues with question marks in post titles? I keep getting a 404 error on a post, but the permalink does not have any punctuation.

    I’m going a tad insane trying to figure it out.

    Click on the first post (chicken or egg) here http://oodalink.com/blog/ . Permalink is http://oodalink.com/operable-or-interoperable-communications-the-chicken-or-the-egg/

    Host is GoDaddy, Linux.

  2. Thanks for the speedy reply. All my other posts don’t have /blog in the URL … and they’re fine. Don’t want the site URL to have blog in it though … blog is a section of the main site.

    In the WP General Settings, the site URL and blog URL are the same (http://oodalink.com) … when I change blog to add /blog … seems like the theme automatically updates all the blog posts’ permalinks to have /blog in it. But this post still doesn’t work that way.

    It’s just this one post giving me grief.

    • Something is wrong with the permalink for that post. I would need to look at the Dashboard and possibly the database to see what, exactly. But rather than worry about that, you can simply copy the content of the post from within the Dashboard and create a new post with the same title. Then see what happens. WordPress will create another permalink with a “2” at the end – or something like that. If the new post gives a 404 error, we go back to the drawing board. But my guess is it will work fine. And then you can delete the other post.

      To follow best practices, you can use the Redirection WordPress plugin so that if the original URL has been indexed or bookmarked, it will redirect to the new one.

      Your suspicion might be correct: the question mark could be causing the problem somehow. The fact that there are two might be significant. You could test this by creating other posts with two question marks in the title. Even though the permalink does not have question marks in it, it still could be choking because there are two. Interesting!

      But believe me, I feel your pain. If creating a second copy does not fix the problem, I would try a title with one question mark – maybe at the end. Do you have any other titles with two question marks? This might be a WP 2.9 bug. I don’t know.

      ADDED LATER:
      I see that you DO have at least one other post with two question marks in the title, so that may not be the issue. Oh well! I would still start be making another copy of the post – with the same or different title – to see if the problem goes away.

      Also, my apologies. I jumped to the conclusion that your WordPress site is at http://oodalink.com/blog but it’s not. It’s at http://oodalink.com and /blog is a page that you display your blog posts on.

      So, I’m stumped. Let me know how the duplicate post idea works out. And, in an effort to sound like I still know what I’m talking about… 😉 I would just point out that you have set permalinks to include only the post name and no other information such as year, month or day.

      One other (very loose) best practice I usually follow is to include the year. WordPress does not do well with permalinks that begin with letters. It does better with numbers – something about the way the database stores the permalink information. That may have nothing to do with your current problem, however.

  3. this permalink with quotes has me stumped. I have magazine articles that have titles that include apostrophes and quotation marks. I don’t want to remove them, as it’s incorrect punctuation, but using permalinks in WP with apostrophes is giving me a 404 when i use category/postname as my format. Removing the apostrophe resolves the issue.

    It’s a bit unclear to me from your comments above if apostrophes can actually be used at all in post titles.

    Any help would be really appreciated.

    • @roadshownews
      Thanks for your comments. If your site is on WordPress.com, it’s unusual for quotes in a post title to cause problems. Are you pasting text into the title from another source like Microsoft Word or another web page?

      Also, note that WordPress allows you to edit the permalink (directly under the box for the post or page title). If there are odd characters or quotes in the permalink, you can remove them.

      Hopefully that helps.

      Beyond that – a couple of suggestions for getting started. Be sure to replace the “Uncategorized” post category name with something meaningful. I use “Latest News” as default. That’s not all that meaningful to search engines, but it’s better that “Uncategorized”.

      Also, I strongly recommend that you register a domain and use that for your site on WordPress.com. You can do so right in WordPress. It costs about $15 a year. This is important for lots of reasons. The main ones are that you will keep the search engine ranking that you establish while you build your site over time, and, if you decide to move the site to third-party hosting (to take advantage of the power you get with a full installation of WordPress), then it will be much easier to do so without having to worry about redirecting visitors that try to go to the old roadshownews.wordpress.com domain.

  4. Thanks Mark for your response. I figured it out late last night that I could edit the permalink to resolve the problem as you suggested, but that would be a bit of a pain when entering all the stories from my magazine. This especially true because I produce my magazines live at tradeshows, so time is limited.

    I think the issue arose do to smart quotes getting into the title field. In building my first posts for my WP site, I copy/pasted headlines and text from my magazine’s Quark layouts and the smart quotes appear to have went over in the process. I think WP doesn’t know what to do with them or does the conversion to html for them correctly, but permalinks does not like the html equivalent.

    Sound right to you?

    I do have a domain and WP on my ISP, roadshownews is just my online WP account. showtimesdaily.com is what I recently set up for my ctnpublishing.com business. Went the domain route after watching one of your great videos on YouTube!

    Thanks so much for your availability for a question. A rare find these days online, except in public forums.

    I’ll e-mail you with a couple things need further and see about your rates, etc. for possibly getting a couple things ironed out and running for me. Being a print magazine guy, my desire for fine-tuned site layout features can tend to be very time-consuming when I have to learn it all myself.

    I am looking for a good solution for displaying a photo gallery on my WP blog ‘site.’ So far, I like Picasa for it’s ability to import metadata for my photo captions and display them right under each thumbnail. Makes the photos much more useful when a viewer scans the gallery. Do you have a favorite plugin for getting such a gallery display of thumbnails with captions on my WP page?

    Thank you again.

    Kirk

    • I think the issue arose do to smart quotes getting into the title field. In building my first posts for my WP site, I copy/pasted headlines and text from my magazine’s Quark layouts and the smart quotes appear to have went over in the process. I think WP doesn’t know what to do with them or does the conversion to html for them correctly, but permalinks does not like the html equivalent.

      Sound right to you?

      This sounds exactly right. It’s always good to get another confirmation of the source of the problem.

      Incidentally, when inserting text into a post or page, you can always paste it into the HTML editing window instead of the Visual editing window. That strips out formatting. If you were to paste the whole story, including the title, into the HTML window, that should remove the smart quotes. You could then highlight and Cut the title from there, then paste it into the Title box. I haven’t tested this, but I think it will work.

      As for good gallery plugins, that’s an excellent question. Being more of a business blogging website guy, I have never used them all that much. I need to start a post on the topic and see what readers recommend.

      Here’s an example of one I like for its ease of use and zero cost: China Photo Safaris. The plugin is called WP Fancyzoom.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: