Recovering Deleted Posts When Using WordPress

This morning I was having some technical problems with my “Learning Ruby – TDD Style!” Parts 1 and 2 blog posts, specifically how pings were handled when linking posts to each other on update. A side effect of a post update meant a comment would be automatically created in the blog post that it referred to. Since I was adding and will continue to add “navigation” functionality for the different post-parts in order to make life easier for the readers, the present set up was not adequate.

When writing or updating a post in WordPress, there is a box on the right hand side of the screen entitled Discussion with an item for allowing pings. The solution was simple enough: All I needed to do was update each page, uncheck Allow Pings, save and delete any lingering ping comments. Simple enough. Somewhere along deleting the ping comments in my early morning haze, I accidentally deleted one of my blog entries!

I was able to verify that I did this by navigating to the user facing page to be greeted by a “Page Not Found” error. Fantastic! Unfortunately, I was quick to find out that WordPress does not have an undelete option for posts and since I visited the user facing page, I no long had my blog entry in my local cache. After hitting up some of the big name search engines to find a cached copy without success, I needed to figure out a better way of recreating my blog entry without having to do it from scratch.

After much cursing took place, I decided to make another go of playing with the cache. The following is the technique I came up with using just the browser I was blogging in:

  1. Put the browser in “Work Offline” mode – usually found under the first couple drop-down menus in your browser
  2. Navigate to the page that was being edited by looking at the browser history
  3. Breathe a sigh of relief when you see your blog entry in the post textarea
  4. Copy and paste your “post” to somewhere safe
  5. Create a new post and paste in your recovered post

WordPress seems to manage their pages for post edits by using the following URL syntax:

In order to figure out your post id, you can always go to the “Manage – Post” section in your blog administration console and see the post ids for the posts that you still have. Using this information you can make an educated guess what the post id is for the post you deleted.

The drawback in using this approach is that your subscribers will end up with multiple entries in their feed of the same title. A small price to pay I figure…


20 Responses to Recovering Deleted Posts When Using WordPress

  1. Funny enough, I had about the same problem with deleted entries and found a solution using the Google cache to manually reconstruct a deleted entry in phpMyAdmin.

    Since my blog is in German, here’s the translation:
    1) Pray the Googlebot’s been at your blog and search the deleted page in Google’s site cache.
    2) Open table wp_posts in phpMyAdmin or similar.
    3) You can recover quite a few things from Google’s cache, like post_title, category ID, article ID, and depending on your template even the rough date and time of publication.
    4) Everything else you can make up comparing your “new” article with another one that exists in your database.
    5) After saving your entry in the MySQL database, your article will show up somewhere in the admin area, but not in the frontend. To achieve that, open wp_posts2cat and add a new entry. You already have post_id and cat_id, and you can fill rel_id with a value that looks good on it, e.g. if one number is missing in that sequence.

  2. 🙂 Oh yeah, and if you subscribe to your own newsfeed in Thunderbird or something similar, you’ll have at least the contents of your article if it is not in the Google cache.

  3. mrhetland says:

    Thank you! Google saved me 😉

  4. kmonty says:

    Your quick thinking saved me after I deleted a post. Thanks for this!

  5. James says:

    I came here trying to find a way of using old post IDs that had been deleted.

    Right now in my blog: I’m on something like id 400 but I need to slip in an old blog post around the 200 mark and have the odd missing id due to dumping drafts or deleting posts.

    How can I revive an old and disused WordPress post ID.



  6. benau says:

    Thanks Ross! This suggestion helped me to save some work after deleting some users from my WP backend and also their posts!



  7. Rajbir D says:

    I’m going to have to work on it now, accidentally deleted stuff myself

  8. சோத்துக்கு லாட்டரி says:

    you made my day! Great idea. you area a star. I deleted my post accidently, since it was new, i could not locate it in google chached! But your ‘offline’ idea saved me!! will sort out by getting a beer, when i meet you!

  9. Thank heavens for your blog post and thank heavens for firefox. This is the only solution that worked for me and I am so grateful that all my work on my deleted blog post wasn’t in vain as I was able to recover it using your method without much effort in reposting the lost article.

    Thank you.


  10. Beirut says:

    You saved my life! I almost had a heart attack when I deleted a blog post that I had written earlier today by mistake! Thank you so much for the advice!

  11. A great post, quite tricky indeed.
    You may have a look at:
    which is independent of any browsers.

  12. TrueThemes says:

    Awesome post. Saved me loads of time. Blessings to you.

  13. WolfAseris says:

    продажа кирпича в Москве – продажа кирпича в Москве – продажа кирпича в Москве

  14. jotirakuc says:

    Good afternoon.
    In clinical trials, the most commonly reported side effects were headache, flushing, and stuffy or runny nose. LEVITRA is available in 2.5-mg, 5-mg, 10-mg, and 20-mg tablets. buying online australia ! now!!
    buy now online

  15. home safes says:

    Cheers! It can be appropriate a chance to bake some
    money and it’s period to take a moment.

  16. I’ve been absent for a while, however this time Going why Which i used to love this website. Thanks , I will attempt to return more frequently. How frequently you you then site?

  17. Shikha Jain says:

    Google catches and wayback machine are the best resources from which we can recover our deleted posts . I have successfully restored some posts through Google cache when i had accidentally deleted 3 posts from my blog . Thanks for sharing these resources with us.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: