You can get new post notifications through RSS, email, Twitter or Facebook
WordPress plugin: Slug Trimmer
I have got sick of URLs that end in really long post slugs that look-something-like-this-and-are-far-too-long so I wrote a little plugin that shortens post slugs more intelligently than simply truncating them.
It works in two phases. It first removes short words (because words like “a” and “the” are rarely significant), shortest first.
If the slug is still too long, it is then truncated. However slugs will never be truncated mid-word.
The size of words removed the the first phase and both the minimum and maximum lengths of the slug resulting can be configured. Truncation can be turned off. The point at which the slug is truncated is set separately from the maximum for the purposes of phase one (word removal).
The slug is generated on saving a post (so you get a chance to look at it before publishing), or on publish. It will not overwrite an existing slug, even one generated by itself. You can force the generation of a new slug by deleting the existing one.
Installation and configuration is simple. Download Slug Trimmer here. If you want to change the configuration, the options will appear as a sub-panel of “Options†in your WP Admin.
If you find this plug useful and feel inclined to do me a favour: I would really appreciate links to any of my money-making sites. I most need links to internal pages of Moneyterms, or to either the front page or the books section of PTZ.com.
Comments(11)
Your plugin skips the trimming if the blogger enters the text right in the Post Slug box when posting.
I tried to hack and then your post slug gets replaced by the title when updating a post.
It is deliberate: I assumed that if someone entered a post slug manually, then that is what they wanted.
What changes did you make to the code.
Here is the link to the modified file.
http://adadaa.com/misc/slug-trimmer.txt
[of course change the extention to .php]
It seems like the function is not at all called when updating a Post. And WordPress somehow replaces the existing Post Slug with Post Title.
Waiting for your update
http://mu.wordpress.org/forums/topic.php?id=2856&replies=5
[…] Also, I’d avoid too many hyphens in the URL, as that can look spammy. Try to keep it to three or fewer. Unless your site is powered by WordPress, in which case Google probably makes an exception for that, given how popular it is and how many legitimate bloggers have loads of hyphens in their permalink URLs. By the way, you can trim those down using the Slug Trimmer plugin for WordPress. […]
[…] words at some point down the road you’ll have problems (if you are on wordpress try the slug trimmer plugin it’s pretty […]
[…] http://pietersz.co.uk/2006/07/wordpress-slug-trimmer “shortens post slugs more intelligently than simply truncating them.”Tags: wordpress, plugin, blog(del.icio.us history) […]
[…] Slug Trimmer – if you use pretty permalinks, they are formed from the titles of your posts. Sometimes the titles are long, and then you end up with a really long URL. This plugin trims the URLs automatically. […]
[…] i.e. to five or six words. There are two plugins to choose from that will accomplish this: the WordPress Slug Trimmer plugin or the Automated SEO Friendly URL […]
[…] i.e. to five or six words. There are two plugins to choose from that will accomplish this: the WordPress Slug Trimmer plugin or the Automated SEO Friendly URL […]
Installation and configuration is simple, it really works fine.
Sorry, comments are closed