We Value Your Privacy

We and our partners use technology such as cookies on our site to personalise content and ads, provide social media features, and analyse our traffic. Click below to consent to the use of this technology across the web. You can change your mind and change your consent choices at anytime by returning to this site.

Update Consent
Loading ...

How to Encode an Apostrophe in a URL

It is not possible to use an apostrophe within a URL you assign to a page or post on your website, even if an apostrophe appears in the page's or post's title. Encode the apostrophe within the URL to ensure readers can access the page. If you attempt to place an apostrophe within your URL, clicking its link takes readers to a "Page Not Found" error.

Loading ...
  1. Type out the title of the page into a desired URL, leaving the apostrophe intact. For example, if the page title you wish to use is "Chocolate's Many Flavors," do this as follows:

  2. http://www.examplewebsite.com/chocolate's-many-uses/

  3. Replace the apostrophe with the HEX code for the character, which is %27. For the example URL:

  4. http://www.examplewebsite.com/chocolate%27s-many-uses/

  5. Save the file. Open your home page in a new tab or window, then click the link to the file whose URL contains and apostrophe. Notice that it opens without incident.

Loading ...

About the Author

Robert Schrader is a writer, photographer, world traveler and creator of the award-winning blog Leave Your Daily Hell. When he's not out globetrotting, you can find him in beautiful Austin, TX, where he lives with his partner.

Loading ...