Adding Security to WordPress.


A friend of mine was reading my blog and he called me to visit him to check his .htaccess file. I went to see him and after the tea, I decided to look into his .htaccess file. I noticed many things were right and well-constructed but a few very important things were missing there. I just needed to add a few security headers to make it safe. Let’s see what I had to add there.

I found the following things were not there in his .htaccess file.

  1. Protection against XSS attack.

  2. Protection against content-sniffing.

  3. Protection against clickjacking and page-framing.

So, I added these following things into his .htaccess file and I placed them all at the very top of the .htaccess file and then I saved the file. It was all done.

You could easily copy these lines from here and paste them into your .htaccess file. Please try to place it at the top of the file.

<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options nosniff
Header always append X-Frame-Options "SAMEORIGIN"
</IfModule>

Now, I feel better telling you about this protection. All the best.

6 thoughts on “Adding Security to WordPress.

  • March 16, 2019 at 4:58 am
    Permalink

    With thanks! Valuable information!

    Reply
  • March 16, 2019 at 10:53 am
    Permalink

    I am not sure where you’re getting your info, but good topic. I needs to spend some time learning much more or understanding more. Thanks for fantastic information I was looking for this information for my mission.

    Reply
  • March 31, 2019 at 11:14 am
    Permalink

    Your web site has exceptional web content. I bookmarked the site

    Reply
    • March 31, 2019 at 12:52 pm
      Permalink

      Thank you, “Alberta”. You could subscribe to get notifications on new posts as well. All the best.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *