WordPress.org

Ready to get started?Download WordPress

Forums

Function to remove non alphanumeric characters when using %postname% Permalinks (1 post)

  1. jmunjr
    Member
    Posted 7 years ago #

    Hi I have wordpress installed on my server. I want to access the MySQL database directly to pull up posts on a specific category and create links to them on a separate non-wordpress page/site. This is pretty easy for me and that is not the issue.

    The issue is I am using a custom Permalink:
    /%year%/%monthnum%/%day%/%postname%/

    I want to be sure of how WordPress "cleans" the titles of each post to transform them into urls. e.g. "News item of the day: becomes "news-item-of-the-day" Perhaps they use preg_replace?

    Whatever the method, can someone tell me EXACTLY how it is done so when I do my thing my links will match. This is actually kind of tricky to make sure they ALWAYS match up.

    I see I can pull up a feed for a specific category. This would work if I used the feed to create my lists but if possible I'd prefer to hit the db directly - though minimal performance would be better.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic