WordPress.org

Ready to get started?Download WordPress

Forums

using mySQL to fix import from Blogger (2 posts)

  1. mbquilts
    Member
    Posted 7 years ago #

    I did get my 5 years of blogger posts imported to WP but the import process put long numbers for all the WP titles (presumably these are the post numbers).

    I've used phpmyadmin to work with the mySQL side of things for other projects, but I'm no pro. I can find the numerically titled posts with this search:

    SELECT *
    FROM
    wp_posts
    WHERE
    post_title >= 30 AND 'post_title' <= 999999999999
    LIMIT 0 , 1300

    would this

    SELECT *
    FROM
    wp_posts
    WHERE
    post_title >= 30 AND 'post_title' <= 999999999999
    UPDATE 'wp_posts' SET 'post_title' = "something new"
    LIMIT 0 , 1300

    work to replace the title with something else - a few hyphens or whatever. I thought about replacing the title with the date, but then I'd have duplicated dates which would look pretty goofy.

    Any help appreciated!

    PS - I did try a plug in that replaces the numeric title with some words from the entry but that doesn't actually change the DB content, just how it appears on the generated page.

  2. mbquilts
    Member
    Posted 7 years ago #

    By george, I think I've got it. Please note that I am not a mySQL expert, but this worked for me and so I post it here in case someone else is trying to do the same thing. You may need to do some trial searches to determine if the upper and lower number will work for you.

    Before doing anything like this, you would be well-advised to back up your database files completely!

    Basically I used this to search the title field for long numbers and replaced it with something not so ugly (at least until I decide what it should be in which case I can do it again).

    UPDATE wp_posts
    SET post_title = '----'
    WHERE post_title >= 30
    AND post_title <= 999999999999999999

    Any comments or other hints appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic