WordPress.org

Ready to get started?Download WordPress

Forums

Mass deleting entries (9 posts)

  1. john74
    Member
    Posted 8 years ago #

    I have a reference to a website on every one of my posts, is there an sql statement I can use that will find and delete this reference rather than me going through every post (more than 1000). Or can you point me in the right direction

    Thanks

  2. Austin Matzko
    Member
    Posted 8 years ago #

    You might try backing up your posts to a text file, doing a text find-and-replace, then restoring your database.

  3. Chris_K
    Member
    Posted 8 years ago #

    Problem with that approach is you'd leave orphans in a handful of tables (post2cat and comments, for example). Not sure if it would restore like that or not.

  4. Austin Matzko
    Member
    Posted 8 years ago #

    HandySolo, I don't follow: how would that leave "orphans"?

  5. Chris_K
    Member
    Posted 8 years ago #

    Every post has at least one record in post2cat (one per category associated with the post). Thus, if you delete the post you'll have post_id's in post2cat that are now orphaned.

    Comments is similar.

  6. Austin Matzko
    Member
    Posted 8 years ago #

    Aah. I wasn't interpreting him as wanting to delete the whole post, just wanting to delete those links from the post. I guess it's the ambiguity of "reference."

  7. Chris_K
    Member
    Posted 8 years ago #

    oh. doh. right, I might have assumed incorrectly!

  8. john74
    Member
    Posted 8 years ago #

    Sorry guys for the confusion in my post, I actually want to delete the link from within the post message itself.

  9. Chris_K
    Member
    Posted 8 years ago #

    Delete the link but leave the anchor text associated with it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags