Ultimate Guide to Securing your WORDPRESS website

seocrab

Elite Member
Joined
May 2, 2013
Messages
1,579
Reaction score
1,991
Here's my guide to making your wordpress websites ultra-secure, using some common sense and tried-and-tested methods to prevent and secure against hacking attempts:

1.
Do not use "admin" as your username! Pick something unique and not related to your niche, e.g. jason647

2. Configure your robots.txt to stop search engines indexing hidden files:

Code:
#
User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins/
Disallow: /wp-content/themes/

3. Delete the readme.html and license.txt files to hide your wordpress version number.

4. Delete the word "wordpress" from your site. Open footer.php, index.php and other site files and manually search and remove "wordpress" references (this can be done using a free text editor or the "Editor" panel in wordpress. Note: the Hide My WP plugin linked below also performs this function.

5. Configure your .htaccess file to:

Protect wp-config.php:

Code:
<Files wp-config.php>
order allow,deny
deny from all</Files>

Block access to plugins:

Code:
# directory browsing
Options All -Indexes

Block access to .htaccess:

Code:
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>

6. Rename your wordpress database table prefix. Change the code in wp-config.php:
Code:
[FONT=Courier New]$table_prefix[/FONT]  = 'wp_';

to:

Code:
[FONT=Courier New]$table_prefix[/FONT]  = 'UNIQUENAME_';
Use numbers, letter, underscores, upper and lowercase combinations.

Then login to your phpMyAdmin page through your hosting cpanel and change all table names. Tutorial with screenshots here:
Code:
http://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/

TIP: it is easier to create a unique table prefix BEFORE installing wordpress. The above instructions are for existing installations.

If you don't like making manual changes or want additional protection, use a security plugin, such as:

Better WP Security
(free)
Code:
http://wordpress.org/plugins/better-wp-security/

Hide My WP
Code:
http://www.blackhatworld.com/blackhat-seo/blogging/548823-get-hide-my-wp-no-one-can-know-you-use-wordpress-3.html

Login Lockdown (free)
Code:
http://wordpress.org/plugins/login-lockdown/

WP Security Scan (free)
Code:
http://wordpress.org/plugins/wp-security-scan/

TIP: If you use pirated plugins/themes, check code manually, only download from a trusted source/sharer, and run security scans before activating.
 
Those plugins are useful.. I use Login Lockdown, Better WP Security, along with Wordpress Firewall 2.

They work really well together.
 
Sounds Interesting, but couldn't find the "Hide My WP" plugin, it seems the file has been deleted by the OP. I have only one doubt: Everyone know google loves wordpress sites. If we hide the wordpress then is there any chance that it will affect SEO benefits..
 
Last edited:
Sounds Interesting, but couldn't find the "Hide My WP" plugin, it seems the file has been deleted by the OP. I have only one doubt: Everyone know google loves wordpress sites. If we hide the wordpress then is there any chance that it will affect SEO benefits..

Here's a link to another Hide My WP thread on here:

Code:
[URL]http://www.blackhatworld.com/blackhat-seo/member-downloads/545999-get-wordpress-hide-my-wp-no-one-can-know-you-use-wordpress-anymore-plugin.html[/URL]

Google "likes" Wordpress because, amongst other things, it functions well: it's got a great structure and integrates with social applications - Google doesn't overtly promote Wordpress as a platform so hiding references to "Wordpress" will not affect your rankings (in my experience). Other platforms will perform just as well, provided the user knows what they're doing. For beginners, I think Wordpress is the best choice for quick ranking, hence the need to understand its security flaws... ;)
 
Those plugins are useful.. I use Login Lockdown, Better WP Security, along with Wordpress Firewall 2.

They work really well together.

Thanks for the feedback - is Wordpress Firewall 2 working with recent versions of WP? Noticed it hasn't been updated in a while:

Code:
http://wordpress.org/plugins/wordpress-firewall-2/
 
Awesome Share. Its Really Helpful for the WP site Owner. Thank you.
 
Do you guys think wordfence is enough for general purposes?
 
I'd like to add Sweetcaptcha to the list of plugins/services to add to your wordpress to lock it down. It's free, it's easy to use, and it kills bots that try to post to your site or break your password.

Also, as a common sense rule, back everything up frequently. Weekly backups are your friend just in case something goes horribly wrong and you have to reload your stuff.
 
Wow! Amazing stuff here. I'll be sure to refer to your post when ever this question pops up somewhere.
 
User-agent: *
Disallow: /cgi-bin
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: /wp-content/plugins/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-login.php
Disallow: /wp-register.php
Disallow: /tag/
Disallow: /author/
Disallow: /about/
Disallow: /contact/
Disallow: /privacy-statement/
Disallow: /comments/
Disallow: /archives/
Disallow: /20*
Disallow: /trackback/
Disallow: /xmlrpc.php
Disallow: /out/
Disallow: /bugs/
Disallow: /suggest/
Disallow: /search/
 
Last edited:
Still,even with the changes,if somebody wants to go into your WP..they will.I was under attack for 3 days and on the 3rd day wordfence security system gave up.The result is 2 new admin user,i have no idea what else did they change in the system,posts,but i deleted everything and put new wp,posts..etc
 
Still,even with the changes,if somebody wants to go into your WP..they will.I was under attack for 3 days and on the 3rd day wordfence security system gave up.The result is 2 new admin user,i have no idea what else did they change in the system,posts,but i deleted everything and put new wp,posts..etc

Ever try "Limit Login Attempts" ?
 
Back
Top