
Two post recovery methods
So, the other day I deleted a post almost immediately after publishing it (although I’m convinced it was WordPress’ fault and not mine
). In the past I’ve been able to recover deleted posts using Archive.org, but that only works if the post has been published for long enough to be archived by Archive.org. If Google’s had time to index the post, I can search for it by title and site using the “site:sitename.com: post title” syntax, and clicking on the “Cached” link to pull up the copy of the page Google has cached on it’s servers as you can see below.
Then I can just copy the text and republish the post. But again, this post was deleted almost immediately after publishing, so I had to find a different way.
Using the Firefox Cache to Recover a Post
Then it dawned on me that I had visited the post a few times while writing it and then once again after publishing, but before it got deleted, so Firefox would certainly have it cached…but how do I recover the post from the cache? Here’s how I did it.
- I did a little searching and discovered you can access the Firefox cache by going to the address bar and typing “about:cache” without the quotes.
- You should see three sections as shown here:
- You may need to search all three sections, but lets start with “Memory cache device” – click on the “List Cache Entries” link in that section
- After that you’ll be faced with a [probably] huge list of all the URLs saved in the Firefox memory cache. Hit Ctrl + F and type the post slug you gave your original post. Here’s mine after searching for “top-wordpress-plugins”:
- Once you’ve found the post, click on the URL and you’ll see another page full of what appears to be quite a bit of gibberish. Copy and paste the entire section, starting with what you see outlined in red below, into your text editor of choice, preferably one with Regular Expression search and replace functionality (take note of the right side of the image – it’s the HTML code for the page we’re looking to recover):
- Once you’ve got all that into your favorite text editor, you just need to get rid of all the extra stuff aside from your post content. I found it easiest to do this using Dreamweaver’s regular expression search and replace. I’m using Dreamweaver’s tool because other REGEX search and replace tools I’ve used just don’t seem to work right for me. Here’s the expression I used, which you can also see in the photo below: [0-9a-z]{8}:s*?([0-9a-z]{2}s*?){16}s
- That allowed me to get rid of all the extraneous characters, but I was still left with my post HTML in a narrow column down the page, so I needed to fix that…I used another regular expression to get rid of all the extra line breaks, but I had to go into the code view to get this done (did I mention the last REGEX was run in Design view?). This time it looked like this: <br />


- Once that was done I ended up with the HTML code for my post nice and clean – albeit on one long wrapped line. From there I just found the post content, copied it, and then pasted it into the HTML editor for a new WordPress post.
- And that’s it. It wasn’t easy, but at least I didn’t have to rewrite the entire post.
Conclusion
Is this the easiest method of recovering a post? Absolutely not! In fact, its a major hassle, and it’s certainly a last resort, but it’s better than rewriting that entire post you just spent a few hours on.






You’ve just saved me hours of re-writing a post that I idiotically deleted without thinking when tweaking my categories.
If you’re interested, I owe this post to you:
http://aquadaily.com/2009/01/06/oxygen-levels-for-fish-and-plants-in-a-tropical-aquarium/
(Please do delete if you’d rather no links in comments!)
Thanks x10 — I aspire to write blogs posts this useful.
Thanks! I’m glad I was able to help!
After replacing the regular expression and , i still have lots of other special characters. How can I remove those. I still cannot get the original content. Please do help.
For instance: How can you recover the original content of the following???
00000000: 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 .PNG……..IHDR
00000010: 00 00 00 06 00 00 00 06 08 06 00 00 00 e0 cc ef …………….
00000020: 48 00 00 00 34 49 44 41 54 78 da 63 58 b5 6a 15 H…4IDATx.cX.j.
00000030: cf da b5 6b 27 03 f1 7b 20 7e 0d c4 f5 fb f7 ef …k’..{ ~……
00000040: 67 61 00 32 e6 03 f1 7f 34 5c 0f 92 f8 8e 45 e2 ga.2….4….E.
00000050: 3b 5e 09 ec 46 e1 b2 1c 00 ac 5a 65 57 55 de 67 ;^..F…..ZeWU.g
00000060: 55 00 00 00 00 49 45 4e 44 ae 42 60 82 U….IEND.B`.
The method described should work if followed correctly. Unfortunately, if it doesn’t work as described, it’s possible that you have some characters that are not being picked up in the regular expression. You’d need to write a different regular expression in that case.
Regular expressions can be complicated to write so it’s hard to say exactly how it would work in your situation.
I realise that this is farily old, and that the person who posted the comment probably no longer cares, but it might help someone else to know that many different file types can be recovered.
That’s not actually a text post, that’s a PNG image – The IHDR IDAT and IEND are all chunks that make it up. It’s actually possible to recover that data, I did so by removing the non HEX parts, and copying the remainder into a HEX editor.
It turns out that the image is 6×6, and contains a grey, aliased, diamond / circle on a transparent background. Somehow I doubt that this is what you intended to recover.
Thanks heaps!!!
I deleted a page and could not recover it the same way, BUT i right clicked and clicked on “View page source” and found the HTML code.
This way I recoverd my page.
Cheers
Hi Trevor, yes, that is a great (and much easier) option if you happen to have the page still open in a browser window
This is a great tip, but it didn’t work for me: it turned out I had disabled my cache at some point, so all I got with “about:cache” was a page saying “cache disabled”. Well, I re-enabled it for next time… (about:config, and searching for cache turned up 2 non-default entries which were set to “false”; I reset them there).