The MU forums have moved to WordPress.org

Allowing dashes in blog names (3 posts)

  1. simplestation
    Member
    Posted 19 years ago #

    Is there an easy way to allow dashes to be used in blog names. For example:

    If your blog was http://somedomain.com/blog/great-videos/

    I would rather NOT have to use a URL like http://somedomain.com/blog/greatvideos/ for SEO reasons.

    When I try creating a new blog with a dash it produces the error:

    "Only letters and numbers allowed"

    Any quick fix?

  2. drmike
    Member
    Posted 19 years ago #

    The check is at line 953 of your wp-includes/wpmu-functions.php file.

    http://trac.mu.wordpress.org/browser/trunk/wp-includes/wpmu-functions.php#L953

    To be honest, I'm not sure how one would add that in there.

  3. HansF
    Member
    Posted 19 years ago #


    preg_match( "/[a-zA-Z0-9]+[a-zA-Z0-9|-]+[a-zA-Z0-9]+/", $blog_id, $maybe );

    ok :
    a-b
    a-b-c-d-e
    not ok :
    a-
    -a
    -a-
    --a-b-c-

About this Topic

  • Started 19 years ago by simplestation
  • Latest reply from HansF