Securing Your WordPress Site After Installation (Firstserv Guide)

This guide covers recommended steps to strengthen the security of your WordPress website after installation.


Before You Begin

This guide assumes:

  • You have enabled SSL (HTTPS) on your domain
  • WordPress was installed using Softaculous
  • The LiteSpeed Cache plugin is installed (included by default with Softaculous installs)

General Best Practices

Keep Plugins to a Minimum

Using too many plugins can:

  • Slow down your website
  • Increase the risk of vulnerabilities
  • Introduce compatibility issues

✅ Best practices:

  • Only install plugins you truly need
  • Choose plugins that are regularly updated and well supported
  • Check reviews and update history before installing

⚠️ Poorly coded or outdated plugins are one of the most common causes of compromised WordPress sites.


Essential Security Enhancements

1. Install a Web Application Firewall (WAF)

A WAF protects your site from malicious traffic and common attacks.

Recommended plugins:

  • Wordfence
  • Sucuri Security

These tools offer:

  • Firewall protection
  • Malware scanning
  • Login protection
  • Additional hardening features

2. Enable Two-Factor Authentication (2FA)

2FA adds an extra layer of protection to your WordPress login.

  • Requires a code from a mobile app or device
  • Prevents unauthorised access even if passwords are compromised

Options:

  • Built-in with Wordfence
  • Plugins such as Google Authenticator or Authy

.htaccess Security Hardening

The .htaccess file allows you to control access and add additional security rules.


Important Notes Before Editing

  • .htaccess files are hidden (enable “Show Hidden Files” in cPanel)
  • They are typically located in your site’s root directory (e.g. /public_html)
  • Always back up your .htaccess file before making changes
  • Even a small error can break your website

Recommended .htaccess Rules

Add any of the following snippets to your .htaccess file to improve security.


Protect Your .htaccess File

 
 
 
 
 
 
Apache Config
 
 
# Deny access to .htaccess
<files .htaccess>
Order allow,deny
Deny from all
</files>
 
 

Protect wp-config.php

 
 
 
 
 
 
Apache Config
 
 
# Block access to wp-config.php
<files wp-config.php>
Order allow,deny
Deny from all
</files>
 
 

Block Access to Core Includes Files

 
 
 
 
 
 
Apache Config
 
 
# Block the include-only files
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
 
 

Disable Directory Browsing

 
 
 
 
 
 
Apache Config
 
 
# Disable directory browsing
Options All -Indexes
 
 

Block XML-RPC Access

 
 
 
 
 
 
Apache Config
 
 
# Disable XML-RPC requests
<files xmlrpc.php>
Order allow,deny
Deny from all
</files>
``
 
 

Why These Changes Matter

These adjustments help:

  • Protect sensitive files from unauthorised access
  • Prevent common attack vectors
  • Reduce exposure of internal system files
  • Improve overall site security

Final Recommendations

  • Keep WordPress core, plugins, and themes up to date
  • Regularly review installed plugins
  • Monitor your site for unusual activity
  • Use backups and security scanning tools

Summary

To improve WordPress security on Firstserv hosting:

  • Minimise plugins and keep them updated
  • Install a WAF plugin
  • Enable 2FA for login protection
  • Apply .htaccess hardening rules carefully
  • Maintain regular updates and monitoring

If you need help securing your WordPress site or applying any of these changes, the Firstserv support team is always available to help.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install the Wordpress Litespeed cache plugin

  LiteSpeed Cache – What It Is and How It Helps If you’re running a WordPress website and...

How to disable the WordPress CRON job and set it up in cPanel

  Optimising WordPress Cron (wp-cron) – Firstserv WordPress does not...

Fixing WordPress mixed content issues

  Fixing Mixed Content Warnings When you visit a website using https://, your browser expects...

How to optimise your WordPress site

Optimising Your WordPress Website (Firstserv Guide) WordPress is a...

Configuring Redis Object Caching using Litespeed Cache

Object Caching and Redis (Firstserv Guide) What is Object Caching? Object caching is a...