Secure your wordpress website from hackers

| Last Updated: | In: WordPress, WP Labs

You may have been working on a website, or reading an article about web development, and heard about the .htaccess file, but wondered what it was, or what, if anything, you can do with it.

This tutorial will tell you the basics about .htaccess, and show you a few ways to secure your wordpress website from hackers


1. Blacklist undesired users and bots ip address

2.- Redirect visitors to a maintenance page

3.- Redirect www to non www or vice versa

4.- Force Caching with htaccess

The following htaccess code won’t help the initial page load, but it will significantly help subsequent page loads by sending 304 statuses when requested elements haven’t been modified.

5.- Allow only your IP address on the wp-admin directory

Allow only your IP address to access administrator area of your website. This will help you from hackers to hack your website. Copy paste code in your .htaccess file and upload it to root directory of website.

6.- The easiest way to ban a WordPress spammer

7.- Deny access to your wp-config.php file

8.- Enable gzip to speed-up your wordpress website

Is your website taking more time to load, if yes, copy paste below code in your .htaccess file. Below code will enable gzip compression for your website, which will reduce web page loading time.

9- Redirect Old domain to New domain

If you want to redirect your old domain to new domain, then create .htaccess file on root of your website and copy paste below code.

10- GZip compression

Please don’t forget to share and subscribe to latest updates of the blog. Comments and feedbacks are always welcome! Thanks!

Tags: , , , ,

About: Prem Tiwari

Prem Tiwari is the founder of and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.

You may also like:

Follow us!

Get Free Access of 400+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...


Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...