• Hi there,
    I have a custom url structure mydomain.com/category/postname.html
    but I want to change my url structure to mydomain.com/articles/postname-post_ID
    Basically I want to replace the extension /%category%/ by /%articles%/, and 6 to 9 digit post_ID which should be unique for each and every post. Anybody help me how to change it whether it is by rewriting the rules or something else?

    • This topic was modified 6 years, 6 months ago by akashhoney.
    • This topic was modified 6 years, 6 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not a Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • /%articles%/

    This is not a valid tag. If you want the literal word “articles”, it has to be a constant like articles and not %articles%.

    and 6 to 9 digit post_ID

    WordPress generates a unique post ID automatically for every item (post, page, media, tag, category, etc), and as far as I know, you can’t control the length. But since it’s always going to be unique, I don’t see the need to worry about the length.

    So you could use:

    /articles/%postname%-%post_id%/

    And you’ll end up with a post URL like:

    https://www.example.com/articles/how-to-tame-a-lion-2302/

    Note again that articles is a constant keyword that will be used for ALL posts, and not a variable tag, as there’s no such placeholder tag as %articles%

    Good luck!

Viewing 1 replies (of 1 total)

The topic ‘Custom url structure’ is closed to new replies.