• First off, I love WordPress. I love the customibility of the URIs. But I have a problem. I have it set up to where the links to posts is “archives/[year]/[post slug]” and I have some post subjects long enough to name emo songs such as, “While we’re at it… (Warning! Lots of [very very poorly] animated penises)” and “The second first is eleventh to last (My advice to you)”. Those make for very very long URIs. They are hard to link to or for people to visit.

    My question is whether there is a hack that will allow me to shorten the post slugs to the three or four first words of the subject without having to manually do it on each post. I thought about editing the .htaccess file but I cannot figure out how to get what I want. I would prefer a plugin or to edit my theme if anyone has any ideas.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • if you are using the latest version of wordpress, there will be a box on the right side of the post screen called ‘Post Slug’

    whatever you change it to, that will be what link name that is used by WordPress and the only link it recognizes, so you can rename your post slug to ‘eleventh-to-last’ and then you’re set.

    The drawback is that the old links won’t work. Unless there is some WP trick to keeping old slugs working that I don’t know about. I’m sure somebody’s made something if you have to bother with that, but it’s more efficient for your system to forget about the old slugs.

    In the future, whenever you’re writing a post, remember that WP auto-generates a slug from your headline, so if you know it’s a long headline, just write in your slug that you want to use when posting. Then you won’t need to go back and edit it.

    Thread Starter semage

    (@semage)

    I was hoping there was a way that I could use both the short and full versions so that either would go to a post.

    I guess that’s all I can do, though. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I need to shorten URIs’ is closed to new replies.