• Resolved ilnk.co

    (@ilnkco)


    Hi

    After importing over 4,000 posts into my site I realised that I hadn’t cleared the trash from previous attempts and now all my posts have the suffix ‘-2’ at the end of the post_name.

    I have done some work post importation so would really like to avoid importing again and don’t want them all ending -2

    Is there a bit of SQL that would look at the wp_posts table and post_name and remove all instances of -2 that it found leaving the rest of the post_name intact?

    For example so that:

    my-first-post-2

    becomes

    my-first-post

    Trash has now been cleared!

    Thanks
    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • Pioneer Web Design

    (@swansonphotos)

    How did you import posts? Method used?

    Thread Starter ilnk.co

    (@ilnkco)

    I used the plugin ultimate csv importer.

    Managed to find a solution:

    UPDATE wp_posts SET post_name = REPLACE ( post_name, '-2', '' );

    Thanks
    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to remove '-2' from post_name’ is closed to new replies.