• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

nSiteful Web Builders

Building a Better Web - One Site at a Time.

  • Home
  • About
    • Testimonials
    • Resources
  • Web Sites
  • Online Marketing
  • WordPress Support
    • Customized WordPress Training
    • 60-for-60 Sessions
  • Web Applications
  • Blog
    • Archive Listing Minimalistic
    • Blog Articles Grouped by Category
    • Case Studies
    • General
    • Portfolio
    • Reviews
    • Snippets
    • Techniques
  • Contact Jeff
    • Purchase Retainer Consulting Hours
    • About Retainer Consulting Hours

By Jeff Cohan, December 7, 2012

Shorten Your WordPress Slugs (Permalinks)

Last updated December 14th, 2012 at 12:43 am

Note: This article assumes you have configured your WordPress Permalink settings to include the post name. If your permalinks use the default setting, then (a) this tip doesn’t apply and (b) you really ought to change your permalink settings to include the post name!

When posting a blog article or page to your WordPress Web site, WordPress will automatically generate a "sanitized" slug which is the defining element of the post in its URL. Unless you manually edit that slug (which can be done in two ways, described below), the default slug will be the title of your post, with all letters changed to lowercase and all spaces and other special characters (commas, slashes, etc.) converted to hyphens or removed.

So, if your blog title is "Piano Lessons" and your Web site is "http://myblog.com", the URL to that page will look something like:
http://myblog.com/piano-lessons/

If your blog title is "Holiday Bazaar", the URL will look something like this:
http://myblog.com/holiday-bazaar/

Let’s suppose…

So, suppose you’re publishing a blog article about the lesson your learned about putting your online banking username and password on a sticky note attached to your computer monitor at work.

You might get creative and entitle your post, "Here’s something really, really stupid I did recently which I recommend you never do" Not a bad title, actually. If I saw title that in my newsreader (or Facebook newsfeed or Twitter timeline, etc.), I might be inclined to click and read.

So that’s the good news.

The bad news is that the URL for your post will be:

http://myblog.com/heres-something-really-really-stupid-i-did-recently-which-i-recommend-you-never-do/

Why is that bad?

  1. Broken Link Syndrome: That URL is so long that if you were to email it to a friend, there’s a chance your friend’s email program would break the link, preventing your friend from getting to the article.
  2. No key words: A Web page’s URL is one of it’s critical search engine optimization elements.

What’s a better URL?

How about…
http://myblog.com/keep-passwords-safe/
or even
http://myblog.com/avoid-sharing-online-banking-passwords/

You get the idea.

How to edit your slugs

Note: In each of the methods described below, the new slug you enter will be sanitized (letters lowercased, spaces replaced with hyphens, special characters removed) after you do the Update.

Method #1

Edit the slug right under the post title in the Edit Post page. Just click the Edit button and enter your new slug. (Click small images to enlarge.)

Method #2

If your screen options for Edit Post are set to display the slug section, find it somewhere on the screen and enter the new slug.

Method #3: Quick-Edit from the All Posts listing

Hover your mouse over the title of the post whose slug you want to change, and a little menu will appear under the title. Click on "Quick Edit" link.

This will expose a whole bunch of settings you can change without actually loading the Edit Post page. Type your new slug in the Slug box, and click Update. (Click image to enlarge.)

Voila!

Postscript: Changing Slugs Retroactively

You might be wondering…

Can I and should I go back and change some of my longer post slugs after the pages or posts have been published?

That’s a good question.

The answer is "probably yes". But here are a few things to consider before you change the slug of any post:

  • Losing people.
    If you emailed the original link to people, or posted it on Facebook — or anywhere else, for that matter — people who click on the original link will end up on your site’s Not Found page. This also applies if the original link of the page in question has been listed by search engines.
  • Losing some search engine mojo.
    If the original link of the page or post in question has already been indexed by search engines, it’s only a matter of time before those engines remove the link (which is, in a way, a good thing, since it’s a "bad" link). But until the search engines index the new link, you’ve lost a place in the search engine results. (Having people go to your Not Found page at least gets them to your Web site.)
  • Internal links.
    If you’ve manually linked to the page or post in question within the body of other pages or posts on your Web site, those internal hyperlinks will no longer be valid. (Small print: Unfortunately, WordPress’ native linking tool in the Edit screen hard-codes the URLs when you create hyperlinks. Some day, WordPress will probably fix that and use the IDs of posts in their linking tool, thus avoiding the broken link problem.)

HTH!

If you have questions or comments, please post them below.

Related Posts

  1. How to embed a YouTube Video in WordPress
  2. What are WordPress Post Formats, and why should I care?
  3. Automatic “Visit Web Site” Links on WordPress Portfolio Posts
  4. WordPress Categories and Tags
  5. Things WordPress Doesn’t Do So Well: Tables
  • Choose the best match.

Written by Jeff Cohan · Categorized: Techniques · Tagged: WordPress

  • Choose the best match.

Reader Interactions

Comments

  1. Chad R. Allen says

    December 6, 2013 at 6:44 am

    Helpful post, Jeff. Thank you! I especially appreciated your comments about whether or not to go back and change a slug after a post has been published.

    Reply
    • Jeff Cohan says

      February 3, 2014 at 9:46 am

      Glad you found it helpful, Chad.

      Reply
  2. Suna Ram says

    February 2, 2014 at 1:30 pm

    Hello Admin,

    Well done for this helpful article. Can you please suggest me the perfect slug of the title. I mean to say that what should be there in slug section ? Can we replace default slug by keywords ? Can we remove few words from default slug for this ?

    So, please help me !!!

    waiting for your suggestion Admin.

    Reply
    • Jeff Cohan says

      February 3, 2014 at 9:46 am

      I like to keep slugs short. I like them to include keywords. I almost always edit the default slugs and remove unnecesary words. For this particular blog entry, for example, I removed the word “your”, which appears in the title but which isn’t needed in the slug (IMO).

      Reply
  3. Suna Ram says

    February 6, 2014 at 3:54 am

    Thanks a lot !

    I got my answer & its working good..

    Reply
  4. uche says

    April 16, 2015 at 10:47 am

    Very helpful Jeff, thank you. I try to make simple and easy to understand post so I am happy to see someone do a much better job.

    I hope to start adding screen shots too, it only get’s better.

    Reply
  5. Rashmi says

    May 14, 2015 at 5:36 am

    Had query about this slug shortening which has always been pointed up by my SEO analysis page. But got my query resolved after seeing your this post. Thank you so much!

    Reply
    • Jeff Cohan says

      May 14, 2015 at 9:04 am

      I’m glad it helped.

      Reply
  6. Deb says

    October 31, 2015 at 5:02 am

    Thanks so much, great info on slug role. Always wondered what it was useful for *smile*. Nice easy, well written explanation Jeff.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

mailchimp signup

Subscribe to get notified when new articles are published. Unsubscribe any time. No spam. I promise. Check out my newsletter archives.

social

Twitter Facebook LinkedIn

Recent Articles

  • Use Case for Custom Post Type: “In The News” March 10, 2023
  • Create a Custom Shortcode to Display a MemberPress Membership Price ANYWHERE on Your Website February 5, 2023
  • Avoid Direct Styling; Use CSS Instead September 21, 2022
  • Blog Tags: What They Are (and What They’re Not) August 5, 2022
  • How to Create a Simple Custom Events Plugin May 24, 2022

Filter By Category/Tag

Categories

  • Case Studies (7)
  • General (61)
  • Portfolio (5)
  • Reviews (12)
  • Snippets (16)
  • Techniques (38)

Popular Tags

Advanced Custom Fields Blogging Child Themes Content Marketing CSS CSS Grid Customer Service Custom Fields Custom Post Types Diagnostics Facebook FooGallery Genesis Gutenberg HTML Images iPhone Libra Live Chat Marketing Media MemberPress MemberPress Courses mu-plugins MySQL Photo Gallery php Pinterest Plugins Post Formats Pricing Project Management Security SEO Seth Godin Shortcodes Social Networking Surveys Taxonomies Trello Twitter Video Web design Web forms WordPress

siteground wp hosting

Web Hosting

wp101

EasyWordPresstutorialvideosforbeginners.
MemberPress CTA

Footer

Background

Web Sites | WordPress Support | Web Applications.

Formally trained in liberal arts and education (I have a B.A. in Government from Harvard and studied Secondary Education at Rutgers Graduate School), I have honed my skills in the communication arts and sciences as a teacher, trainer, instructional designer, writer, photographer, calligrapher, helpdesk manager, database programmer, and multimedia developer.

(I've also been a group counselor, waiter, bartender, bicycle messenger boy, computer salesman, carpenter's helper, financial analyst, and school board president.)

Tech

Systems since 1983.
Web sites since 1994.
PHP since 2001.
WordPress since 2007.

Contact

770-772-5134
Email Jeff
Send Money
All Ways

Copyright 2023, nSiteful Web Builders, Inc.

 

Subscribe

Pardon the interruption. I know popups can be annoying. But I’d love to have you as a subscriber.

Sign up to be notified when new articles are published. Unsubscribe any time.

* indicates required

Powered by MailChimp

×