I use WordPress as the backend of almost all of my websites and blogs. I am addicted to it, now I don’t know if that’s a good sign. Most of the time I am digging it to learn new codes and find flaws or glitches. As you all know, wordpress is the most popular blogging platform, it is easy to customize and free of cost. You can easily create an amazing page or a blog with the help of the plugins, widgets and ready-made templates.
Ok, now the real deal: Recently, I found out that a bunch of blogs running on WordPress were exploited by hackers. You should stop what you are doing right now and read and learn whatever I have to say today.
Security of blogs and websites is very important and I believe I should have made this post earlier. Today, I will try my best to address the need for security effectively.
Recently, some of my online buddies notified me of this exploit and how their wordpress blogs got infected with iFrame interjections. In simple terms, what this means is that the hacker places a code within bunch of WordPress files and folders including /themes, /plugins, /wp-content, /wp-includes, page.php, index.php etc. The hacker gets in your mySQL database and adds all these pesky iframe codes to all the pages and posts.
Common Questions:
Q. Why and how does my site get exploited/hacked?
There are several possibilities:
- Your computer might be infected with a Trojan or virus that transmits all your personal and ftp details of your site.
- You might have visited an infected site (these are mainly created by scammers).
- You might have downloaded a corrupted wordpress plugin that was infected with a virus. (not all wordpress plugins are legit).
Q. How many hackers can attack my blog?
Your blog can get exploited by one or even several hackers. If this happens, it will be quite annoying and time consuming to clean all the mess.
Q. How do I know if the attack was carried out by one individual or many?
This is simple, if the attack was carried out by one person, the iframe code would be the same. If it was done by several, the specific iframe code would be different for several sites. It is quite easy to search your database for “iframe” but then it is difficult if the files/codes are encoded and executed as a script.
Q. How to avoid getting exploited?
There could be several other ways to avoid getting hacked and if you have something new to contribute then put it up in comments. Here are some of my suggestions to stay safe:
1. First, make sure you have a good anti-virus installed on your system. Set it up to update automatically or you can do this manually when new updates are available. Most anti-virus tools scan your computer on restart or once a week. If you don’t have this option setup, do it manually when required. I use NOD32 and Spyware Doctor which I think are the best. NOD32 is very light on your system, takes the least space, auto updates and performs really well. To name a few more, you can also use Bit defender, Avast and AvG. (Please stay away from Norton, I personally think they are useless, takes up more space and slows down your system)
2. Most of us use a FTP client for accessing the files in our server. I use the FileZilla client which is fast, free and user friendly. When using a FTP client, make sure you go through a secure connection. Most FTP clients and websites offer some sort of encryption so you should be safe. When entering your User/Pass, just take a look at the URL and make sure it is not funny looking. ![]()
3. If you are setting up WordPress for the first time then change your database table prefix. In simple terms: the default database prefix is “wp_” and most of us ignore to change this. The hacker usually will look for such prefix and set up the virus to exploit them. If your table prefix is “wp_” or “wp1_” or even “wordpress_”, then changing it will bring your WordPress site security to a higher level.
4. Download all your WordPress plugins from the main site, wordpress.org. Try to avoid 3rd party websites as much as possible.
5. Backup your /wp-content folder and your mySQL database regularly. You can use WP-DB-Backup for your database but, however, you have to manually backup the /wp-content folder. If by any chance your wordpress blog gets exploited, you can easily revert to the last working stage.
Things to do when your WordPress blog gets hacked
Do not panic and take it easy. If you keep backups of your files and database, you should not worry much.
- Change your FTP password
- Re-Install a fresh WordPress
- Set up your theme and plugins (the ones you use on your blogs)
- Import your previous and working mySQL database (the one who backup frequently)
- It should be working just fine now
What if I don’t have backups of mySQL database?
You better not say that
.. I have always mentioned how important it is to backup your files. If you have been following me and my blog, please I request everyone to make frequent backups of your files and database.
Anyways, if you don’t have backups then it gets a little complicated but not impossible:
- Install the latest working version of wordpress
- Set up a theme and plugins that you use.
- Scan through and check each and every HTML file in your server. Also check the files that seem suspicious. Usually the exploit/code is placed at the bottom of files (it could be a script of a HTML iframe code)
- Login to your mySQL database and scan through the files– run a search for the following:
| SELECT * FROM wp_posts WHERE post_content LIKE ‘%<iframe%’ UNION SELECT * FROM wp_posts WHERE post_content LIKE ‘%<noscript%’ UNION SELECT * FROM wp_posts WHERE post_content LIKE ‘%display:%’ |
You may find the following plugins useful:
I tried to be accurate and to the point. I hope you know the importance of security of your blog after reading this post. Prevention is better than cure. There might be more to this and maybe I am missing out several stuffs but, there will be several follow-ups
and i will keep you updated. Just make sure you subscribe and stay in the loop.
Did you enjoy this article? Sign up for the "14 Day Blogging e-Course" & take your blog to the next level, Guaranteed! | ![]() |
![]() | We hate spam just as much as you |





{ 6 comments… read them below or add one }
Great list of Wordpress Hacks. Didn’t see anything about Permalinks, SEO, or Multiple Social Bookmarking. However, on your blog you incorporate these points.
All the Points are good which u have mentioned about wordpress blog hacking..
Jacob Luis
Great list of Wordpress Hacks. Didn’t see anything about Permalinks, SEO, or Multiple Social Bookmarking. However, on your blog you incorporate these points.
These hacks worked at the time they were published, but as new versions of WordPress are released, some may no longer work.
Great tips! But… “8. Easily Prevent Comment Spam” has some issues. I mean, it works very well… well too much. For me, the hack was blocking my own pingback and others trackback.
Your post on “ss Tricks and Hacks” is a good example so I hope that you can keep providing information. I wish you every success.