Viewing 5 replies - 1 through 5 (of 5 total)
  • Well, the problem with automatic is you may end up with ugly URLs.

    Example:

    Post title – This is my post title and it’s really cool
    Auto-slug – This-is-my-pos

    Eww.

    I’d say just use the advanced editing form as your default and make your own slug for those long titled posts as you type them. Is it really that hard? ??

    Thread Starter guarriman

    (@guarriman)

    Hi Viper007Bond. Thank you very much for your answer.

    I don’t mind if the URLs are ugly.

    Anyway, I modified ‘functions-formatting.php’, and added this line
    at the end of ‘function sanitize_title’ (before returning $title):
    $title = substr($title, 0, 30);

    It works.

    Thread Starter guarriman

    (@guarriman)

    Mmm… it doesn’t work ??

    If I include that line, then old permalinks don’t appear.

    Can anyone make a plugin that does this? Or include this option in the official wordpress code? I run a multi-user blog, and while I can usually remember to truncate my post slugs, other people don’t. I want to prevent the URLs from getting too long *automatically.*

    mightymouse

    (@mightymouse)

    I’ve just created a plugin to do this. Take a look at the anouncement: https://www.ads-software.com/support/topic/94617
    and download the plugin at:
    https://www.york-newyork.com/seo-plugin-wordpress-urls/

    cheers,
    mightymouse

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to limit the length of an URL (Post slug)?’ is closed to new replies.