WordPress.org

Forums

how to recreate db's "nice names" for imported content? (6 posts)

  1. junap
    Member
    Posted 10 years ago #

    hi all,

    I'm using phpMyAdmin to pull across content from phpBB into WP, but I'm running into problems when it comes to the fields such as post_name, user_nicename, etc. where regex / sanitised versions of the data are stored. I'm bluffing my way with most of this, so am not sure what to do here. Is there any way that I can filter the text within MySQL?

    thanks

  2. Kafkaesqui

    Posted 10 years ago #

    If there is, it would probably take a SQL developer with years of experience to figure out how to do it. And she might only chuckle at the request.

    If it's possible, I think your best option is to pull the data in, then have a PHP script that's plugged into WordPress' functionality perform the filtering of a post title and update the post_name with it.

  3. junap
    Member
    Posted 10 years ago #

    hmm, I was afraid that might be the case.

    I guess my next question is: could anyone suggest the necessary PHP code to do it?

  4. Kafkaesqui

    Posted 10 years ago #

    Look over the sanitize_title_with_dashes() function located in wp-includes/functions-formatting.php.

  5. MattRead
    Member
    Posted 10 years ago #

    junap, if you run upgrade.php it will populate a lot of that data. At least that's what I've heard ;)

  6. junap
    Member
    Posted 10 years ago #

    MattRead, you rock! It did indeed do the trick, many thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic