The other day while updating one of my posts I accidentally deleted the posts’ content. How this came to happen was initially a mystery to me but a few moments later I realized my error.
Basically I was editing the content in HTML view (this was on Blogger by the way) and I ended making some unwanted changes. Adamant about reverting the changes manually I started hitting Ctrl+Z to undo them.
It all went well until the post editor went completely blank. I guess this is one of those Blogger issues that we have to adapt to. Seeing this I proceeded to stupidly hit the revert to draft button thinking that would revert the post to its original state.
Wrong! It ended making the now empty post the new draft. The post was gone for good and to complicate matters was already indexed by Google as I had published it a week earlier.
So what do you in this situation?
Google Cache to the Rescue
Well, I had an early draft but it was no good not to mention it was in plain text. It’s here I contemplated making a redirect for the time being as I worked on the post from scratch.
But then it occured to me: since Google Search had already indexed it, maybe, just maybe, an offline google cache of it would be available. Turned out I was right. Better yet, I ended up not typing anything in the process. Here’s how I did it.
- This assumes that your post had already been published and crawled/indexed by Google Search.
Step 1: Find the Cached Post
1. Go to Google and search for your deleted post.
- Do a narrow search to get it quickly e.g. by including your blog’s name along with the post title.
- You can also do a site only search by using the site modifier e.g. site:www.yoursiteaddress.com “deleted post title”
2. If it had already been indexed you should see it most likely on the first page of results.
3. At the end of the post’s URL in the results, click on the small down-facing green arrow to reveal a hidden menu. Next, click on the Cached button.
4. You should now be able to see a cached copy of the deleted post as it appeared on your site when Google crawled it.
The cache does allow you to switch among three view options:
- Full version – this displays post as it appears on your website (i.e. with the template/theme, pictures and even live ads)
- Text-only version – this one displays a text only version of the website with the post (no images or template)
- View source – this one shows you the HTML code of the post as it appears along with your website’s template/theme.
Step 2: Restore the Deleted Post using the Cache’s Source
The easiest way to restore your post content which you already know by now is to just copy and paste from the Full or Text only versions of this cached copy.
This may however not be sufficient if the post had a lot of images and links. This was my case – I wanted to avoid re-uploading those images (or the alternative which was digging them up from my Blog’s Gallery) not to mention having to put them in the correct positions all over again.
So what I did is switch to the View source version and copied the HTML section of the post content only (left out the template code). I then pasted this code into the HTML editor in Blogger and my post was back as I had last published it. The images and links were all there.
Just copy the code where the post begins (the first sentence, heading or image) up to where it ends and paste this into your websites/blog HTML editor. Then of course preview it in the WYSIWYG/Compose editor to make sure it looks as expected before republishing it.
If you’re not intimidated by code do give this a try. It will no doubt save you a lot of time. Cheers!