What to Do If Your Website Ever Gets Hacked

Last weekend, my blog was hacked. Within a few hours, everything was back to normal. But it was scary. And I didn’t know what to do.

My guess is that some bloggers are as ignorant as I was of what to do. In fact, if I weren’t fortunate enough to get some help, I would’ve been doomed. So I thought I’d share what I did, along with tips for what to do if your blog ever gets hacked.

Locks on a door

If your site gets hacked, you gotta lock it down! Photo credit: Flickr (Creative Commons)

Tell the world

As soon as my blog was down, I let people know via Twitter and Facebook (since people were already asking why I was sending them to a loans website). This accomplishes two goals:

  1. It sets reasonable expectations for readers, friends, and fans.
  2. It lets people know that you need help. (I’ve found that the Twitter community can be especially resourceful when it comes to technology issues.)

Contact your host

Not quite sure what to do, I first contacted my host. The folks at Site5 responded immediately (at 11pm) and removed the line of code that was injected into my site to redirect to a loans site.

They removed it, and everything was back to normal.

Or so it seemed.

I quickly realized that while my homepage was restored, all my files (i.e. posts and pages) were corrupted.

Undo the damage

A friend on Twitter offered to help fix the problem I was having (since I was tweeting the whole experience). I really cannot say enough good things about Mitch Canter (@studionashvegas). Seriously, if you have any WordPress/website/blog needs or desires, he’s your man.

Within 15 minutes, my site was back to normal. (Thanks, Mitch — you really saved my life, or at least, my blog.

Readers: Follow Mitch, send him chocolate, and consider hiring him.

Change all your passwords

Next, I changed all three of my passwords for my blog: site admin (i.e. FTP login), WordPress login, and my “backstage” login to access my server.

I auto-generated a complicated password that I had to write down and save, so that I could remember it next time I log in to my FTP. I’m ashamed to admit that two of my passwords were the same and would have been pretty easy to guess.

Install a firewall

My friend Ryan (who once had 100 WordPress blogs crash in one day due to a hacker) recommended a WordPress firewall plugin.

This is a free program that protects your blog from attacks and injections (whatever those are). When someone tries to hack your site, it sends you an email to notify you.

Other takeaways

I learned a few takeaways from the experience:

  1. Backup all your files, so that if you do lose something, it can be easily restored. (If you’re on WordPress, check out my friend Adam’s tutorial for backing up your blog.)
  2. Save your drafts offline. I’m moving over all my posts to Evernote so that they’re saved in the cloud. In the terrible event that I might lose all my posts, I could then re-post them. I also now save a copy of post drafts on my computer in my “blog” folder.
  3. Be ready. Every blog that I follow and respect has been hacked at some point. Plan for disaster. It will happen.

Concluding thoughts

  • Having a good, customer-friendly host is essential.
  • Having a friendly, neighborhood geek you can call up is really important.
  • Having a great tribe and online presence in other social media outlets really helps. Within minutes of my site being down, people were notifying me. I am so grateful for the community this blog has created.

Further reading:

Has your blog or website ever been hacked? What did you do? Is your site ready for an attack? Share your thoughts and best practices in the comments section. (Click here if you’re reading this via email or in RSS.)

*Photo credit: Flickr

About the Author

Jeff Goins

I help people tell better stories and make a difference in the world. I live in Tennessee with my wife and dog. Follow me on Twitter and Facebook.

  • http://michaelhyatt.com Michael Hyatt

     Jeff, I have had this happen, too. We made numerous adjustments because of it. I would also suggest using VaultPress to back up your WordPress files every hour. It is expensive but a life-saver. It is made Automattic, the same folks who make WordPress.

    I would also recommend 1Password for all your passwords. This way you don’t have to remember them. The software does. I generate 16-to-20-character, complicated passwords for everything. They are all different, but 1Password remembers them all.

    • http://goinswriter.com/ Jeff Goins

      Good tips, Mike. Thanks.

  • http://davidsantistevan.com David Santistevan

     A massive resource, Jeff. Thanks. This has not happened to me yet but I should probably take the necessary precautions.

    • http://goinswriter.com/ Jeff Goins

      Thanks, David. I would strongly recommend it. Not to sound all gloom and doom, but you should prepare for the worst.

  • Karen

     Wow! Thanks Jeff! I am saving this article in its very own folder. I, too, am guilty of poor password choices. All of that changes now I really appreciate you sharing your story and the great resources you used to get out of a “pickle.”
    Thanks!

    • http://goinswriter.com/ Jeff Goins

       Thanks, Karen. I just kind of stumbled out of it — not very intentional. Without community, I would’ve been up a creek. I wrote this so that others could more intentionally prepare.

  • http://robrash.us Rob Rash

     Been there man. I had a business website that was hacked by some dude in the middle east. Not fun.

    I’m gonna have to get that WordPress Firewall plug in for my personal site… just to be on the safe side.

    Thanks for sharing Jeff!

    • http://goinswriter.com/ Jeff Goins

      No problem, Rob. Yeah, it’s free, so why not?

  • http://twitter.com/ethanwaldman Ethan Waldman

     Jeff- Thanks for the tips.  I’ve always wondered how common this is and what I can do to prevent it.  

    • http://goinswriter.com/ Jeff Goins

      You’re welcome, Ethan. More common than it should be. EVERY blogger whom I respect has been hacked.

  • http://www.thedailywalk.net Adam

    This has happened to me and it really stunk. It is so important to have those backups!

    What was the name of that firewall plugin?

  • Anonymous

    Thanks for the blog Jeff… I am going to read up on this and make sure it doesn’t happen to me… Good to connect… Geoff

    • http://goinswriter.com/ Jeff Goins

      Likewise, Geoff with a G. ;)

  • http://thoughtsaboutnothing.com @kylereed

     I have had clients blogs hacked and it sucks. It is never good to get that email for phone call. 
    I am thankful for friends who helped me figure out what was going on because If I didn’t have them I would have been in some trouble

    • http://goinswriter.com/ Jeff Goins

      Ditto! any other tips you’d recommend, Kyle?

      • http://thoughtsaboutnothing.com @kylereed

        from my experience it is watching yourself on open networks. That is where I have seen it happen the most. Anytime someone is on an open network like a coffee shop or something like that your stuff is accessible. Changing passwords often helps a ton 

        • http://goinswriter.com/ Jeff Goins

          interesting.

  • http://www.marianneworley.com Marianne Worley

    For a completely non-technical person like me, this post is critical. I just installed the firewall plugin. I’m just about to run a backup to my Iomega eGo drive too. Thanks Jeff.

    • http://goinswriter.com/ Jeff Goins

      very cool, marianne. i’m right with you.

  • Anonymous

    Excellent advice. I just realized that my backup plug-in isn’t working – WTH? Thanks for the reminder. Dumb question, though – if I change my WordPress password, are there any implications for working with plug-ins or other programs? I’ve changed site passwords for other sites before and there’s been a time-consuming ripple effect…

    • http://goinswriter.com/ Jeff Goins

      not that i know of.

  • http://www.tillhecomes.org Jeremy Myers

    Great tips. I’m glad things are back to normal now.

    • http://goinswriter.com/ Jeff Goins

      Me too.

  • Linnette Mullin

    Thanks for sharing, Jeff! :D

  • Bkantarjian

    I am saving this. Just this week I received email asking if I had requested a password change for my blog anhinga.wordpress.com. NO. Thank you so much for sharing.

    • http://goinswriter.com/ Jeff Goins

      You’re welcome!

  • http://www.seoweave.com/ Greg Fowler

    Great information, our site has been hacked, and destroyed our rankings in Google in one day because the hacker installed re-directs.  Restoring the site is pretty much the easy part, but getting the rankings back?  That is a whole different story.