# How to secure WordPress : WordPress security

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html
- Published: 2013-09-13T12:30:00+05:30
- Author: Aditya Nath Jha

![how to secure wordpress inspire2rise guide](https://www.inspire2rise.com/wp-content/
uploads/2017/08/how-to-secure-wordpress-inspire2rise-guide.jpg)

How to Secure WordPress : The WordPress Security guide!

**WordPress security** is something which makes users of WordPress bite their nails.
WordPress is a CMS – Content Management System built using PHP and other scripts.
So, it has vulnerabilities too. Out of the box [WordPress](https://www.inspire2rise.com/free-hosting-wordpress-guide.html)
is pretty vulnerable to even basic attacks and if you are being targeted your site
would be down within a few hours. WordPress can be easily brought down if you are
not securing it good enough. There are several ways to secure WordPress, via .htaccess
file, through your Cpanel and most easily via WordPress plugins. How to secure WordPress
is a great question, today we at Inspire2rise hope to answer it!

Table of Contents

 * [How to secure WordPress : WordPress security – Change your habits.](https://www.inspire2rise.com/how-to-secure-wordpress-security.html#How_to_secure_WordPress_WordPress_security_%E2%80%93_Change_your_habits)
 * [Related](https://www.inspire2rise.com/how-to-secure-wordpress-security.html#Related)

### **How to secure WordPress : WordPress security – Change your habits.**

Security is a state of usage. Your usage patterns affect security the most. Are 
you on a vulnerable system? Let’s answer your question of** how to secure WordPress**
default installation by few tweaks and changes.

Let’s break security into three parts.

**1.) System Side security :** If you are on a compromised system i.e one with viruses
and other spyware then you run a heavy risk of getting your site infected. Never
log in to your website from Cyber cafes, public terminals, or any system that you
believe is infected. Some infections are so discrete that they can’t even be diagnosed
from the dashboard or site behavior. Use a proper antivirus on your systems, an 
updated operating system and a latest web browser for all your work purposes.

    ```
    Reading now : How to secure WordPress.
    ```

**2.) Server side Security : **If you have your WordPress installation set to the
default settings that were set up during installation, then you are inviting trouble
for sure.

 * Want to know how to secure WordPress, then keep your WordPress updated. Always
   have the latest version. Half of the work is done by doing this.
 * Keep the username and password hard. If it’s something less than 12 characters
   or something so easy like “MyPassword” then you will get hacked for sure. Always
   have strong passwords with unique combinations. As I do you can also try to mix
   different languages while framing your passwords. For instance my passwords usually
   contain traces of Sanskrit, Italian, English and Hindi. And add to that combo
   special characters and numbers. Then you have a hell of a password.
 * Safeguard yourself from Server vulnerabilities. If you are on a shared hosting
   plan and other sites on the same server as you are infected then there is a high
   chance of you too getting infected.
    To avoid it is really difficult apart from
   password protecting your important directories like wp-admin. So choose a reliable
   [web hosting provider](https://www.inspire2rise.com/web-hosting-reviews-speedhost.html)
   who have a strong security track record.
 * How to secure WordPress : Backups – Perform regular backups of your files as 
   well as your database. Disasters strike without warning, one infected plugin 
   or theme and all comes crashing down. Better be prepared.

    ```
    You may like : Free hosting WordPress guide.
    ```

**3.) Use .htaccess to stop hacking attempts** :

Learn more about  How to Make Money on Amazon in 2026, Amazon Affiliate Marketing
Guide!

![How to secure wordpress with htaccess file](https://www.inspire2rise.com/wp-content/
uploads/2017/08/how-to-secure-wordpress-with-htaccess.jpg)

How to secure wordpress with htaccess file.

.htaccess file is the key to WordPress security. It stands for Hypertext Access 
file. It’s the file which controls whatever directory it is in. It’s the configuration
file for a particular directory. If you do not want to edit .htaccess manually and
want to do it via WP dashboard then use this [plugin](http://wordpress.org/extend/plugins/wp-htaccess-control/).
In this plugin’s options you can configure your .htaccess for security. Here are
some manual tips to configure .htacess :

    ```
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>
    ```

The above code protects the wp-config.php file which is the most targeted.

    ```
    Reading now - How to secure WordPress : WordPress security.
    ```

There’s this particular piece of code which prevents directory browsing, using this
code you can discourage future attackers from knowing your site’s internals.
 There
is also .htaccess code available for protecting the wp-content directory.

    ```
    # directory browsing
    Options All -Indexes
    ```

    ```
    order deny,allow
    deny from all
    <files ~ ".(xml|css|jpe?g|png|gif|js)$">
    allow from all
    </files>
    ```

    ```
    You may like : Ultimate guide to WordPress SEO by Yoast.
    ```

.htaccess code to prevent stealing of bandwidth : Hot linking i.e using images and
resources present on your server for own use by others is what steals up most of
your bandwidth.  The below code stops hotlinking done by others.

    ```
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?YourDomain [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
    ```

Change the above code to have your domain name in the place of the phrase “YOURDOMAIN”.

    ```
    Reading now - How to secure WordPress : WordPress security.
    ```

And the most important step to follow for .htacess protection is to protect the .
htaccess from being written upon by others.

This code that follows can stop anyone from accessing any file on your server which
has a name which has the string “hta” in the beginning.

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

The above methods were all manual and can be done by anyone to secure their WordPress
site via .htaccess.

    ```
    You may like : Blogging tips guide.
    ```

**4.) Using CDNs to boost WordPress security :** One of the better ways to protect
your WordPress site is to use a free CDN like Cloudflare or [Google Pagespeed](https://www.inspire2rise.com/set-up-google-page-speed-best-settings.html).
They filter the suspicious bots and malicious traffic and protects the websites 
from basic attacks.

    ```
    Reading now : How to secure WordPress.
    ```

**5.) Final and sure shot method – Use security plugin : **Install a security plugin
like[ Better WP Security ](http://wordpress.org/plugins/better-wp-security/)or [WordFence](http://wordpress.org/plugins/wordfence/).
Better WP security plugin is the best out there, find out how to customize it better
[here](https://www.inspire2rise.com/top-ten-plugins-for-wordpress.html). It can 
do all of the above manual setup with the help of just a few clicks. Every .htaccess
trick can be done with the help of Better WP Security. But enabling the option of
making .htaccess and wp-config.php non-editable can create some problems. Because
of some poorly coded themes and plugins it can break access to your site.

    ```
    You may like : Tips to improve Alexa ranking.
    ```

    ```
    DISCLAIMER : Follow this guide at your own discretion. Doing things incorrectly may damage your site.
    ```

So, this was Inspire2rise _How to secure WordPress : WordPress security guide_. 
If you have any doubts regarding our WordPress security post then do comment below
and share your experiences. We will surely help you become more secure.

Learn more about  Vu Televisions leads the 4K television industry with the launch
of Vu Premium 4K TV!

Follow [Inspire2rise on Facebook](http://www.facebook.com/Inspire2rise) | Follow
[Inspire2rise on Twitter](https://www.x.com/Inspire2rise).

### _Related_

## Comments

### By: Ashwani Kumar Singh

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19316
- Published: 2013-09-13T16:11:19+05:30

Great article Aditya. Recently my site was being attacked by hackers and I was looking
for ways to tackle this situation. I hope the methods described in the article will
help me. 🙂
 Cheers 🙂

### By: Pramod

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19354
- Published: 2013-09-15T19:54:42+05:30

Hi Aditya !
 Thanks for sharing these mod rewrite rules with us . Its very important
to secure our WordPress blogs and it can be done with WordPress security plugins
and through the mod-rewrite rules in htaccess files that can prevent intrusion attempts\
+ bad bots from attacking our sites .

\-Pramod

### By: Aditya Nath Jha

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19390
- Published: 2013-09-16T19:24:13+05:30

Yes Pramod, the main aim for writing this guide was this only! Keep visiting Inspire2rise.
com

### By: Ahsan@Android Apps

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19410
- Published: 2013-09-17T22:02:25+05:30

Hello Aditya Nath Jha,

For a WordPress user, it is a very important post. I generally install 2-3 plugin
to secure a site as I don’t know coding. But I think its best way to secure a website.
So the site will also load fast

### By: Aditya Nath Jha

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19432
- Published: 2013-09-18T19:14:51+05:30

Hmm, that’s why I included every possible thing that I had learnt in the previous
years!

### By: Nirmala

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19470
- Published: 2013-09-26T11:02:18+05:30

Very useful post for the WordPress users, specifically for new users.

Security to our blog is most needful one, as the hackers are intelligent in capturing
the websites with low protection.

I learned some good stuffs here and am using the plugin “Better WP security” as 
you specified.

Keep sharing the useful WP stuffs for us 🙂

### By: Aditya Nath Jha

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19471
- Published: 2013-09-26T11:19:39+05:30

Hmm, that’s why one in a while I post things like this. People really need to get
help in such issues. Many new people ping me day and night asking me the same exact
questions that I try to answer in my posts! 😀
 Keep coming Nirmala! 🙂

### By: Goals hunter

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19680
- Published: 2013-10-17T18:10:58+05:30

Thanks buddy it helped me a lot in securing my WordPress!

### By: dailytut

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19825
- Published: 2013-11-29T16:25:52+05:30

Best tips (Y) to secure wordpress blog. This post deserves more shares.

Robin

### By: Aditya Nath Jha

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19826
- Published: 2013-11-29T19:20:54+05:30

Thanks man, most people just don’t appreciate the kind of hard work put on this 
website. 😀
 Stay Inspired to rise!

### By: georgeranjeev

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19850
- Published: 2013-12-12T22:48:26+05:30

There is one more plugin named hide my wp,its worth money.

### By: Aditya Nath Jha

- Link: https://www.inspire2rise.com/how-to-secure-wordpress-security.html#comment-19852
- Published: 2013-12-12T23:06:42+05:30

Hmmm, I will surely check it and add it in this list! 🙂
