WordPress is a user-friendly content management system. When it comes to the security of WordPress it has been an important role. Because many of the WordPress websites are being hacked or they have security issues and to secure WordPress websites, proper measures should be taken by the system administrator and the developers.
We can prevent it by implementing security measurements in WordPress level and Server level. If you need to set up a highly secured WordPress dedicated server, please refer to our server management plan or do contact us.
Choose a secured Web Hosting service
The webserver that WordPress is running has the chance of vulnerabilities, if we are using the old PHP version it will cause security threats. We should be bothered about several server-side security protections.
Use the latest PHP version (PHP 7.4) greater and Mysql 5.6/MariaDB latest with the latest Apache or Nginx web server. Also do check the following points are done.
1. HTTPS and HTTP2 support should be enabled.
2. Web Application Firewall (WAF can be used to restrict incoming and outgoing network traffic)
3. Intrusion detection system
Use Strong Admin Logins
To prevent a Brute force attack and other security issues we can use a strong password. For generating a strong password we can use password generators and do not use frequently accessible names for passwords.
Protect WordPress Admin
If your WordPress site doesn’t support registration or front-end creation, your visitors should not be able to access the /wp-admin or /wp-login.php folder. For this, we can use .htaccess file rule.
<Files wp-login.php>
order deny,allow
Deny from all
Allow from xx.xxx.xxx.xxx
</Files>
Take Regular Backups
WordPress is a web application based on PHP and MYSQL and we can take a backup of full site including files and databases manually on a daily basis. So we can restore it immediately without data losses if any issue occurred. A scheduled backup system can be implemented with our server management plan.
Monitor the website
We can monitor the uptime and website performance using opensource monitoring tools and it will provide the CPU usage, uptime, downtime, Memory usage, etc. Your website and server will be under 24/7 monitoring with 1 min interval on our management.
Keep WordPress and plugins uptodate
Keep your WordPress and plugins up to date by update the WordPress to the latest version, the themes, and all the active plugins to the latest versions. Before the update, you should take a full backup of your WordPress site. Remember to uninstall all unused plugins and themes from your WordPress site always.
Check permissions
The folders and files inside the WordPress installation directory should have the correct ownership and permissions. Otherwise, it will be easy to hack the files and folders. The files should have the permission of 644 and folders should have the permission of 755.
Files Permissions can be corrected by
find /path-of-wp-files/ -type f -exec chmod 644 {} \;
Folders Permissions can be corrected by
find /path-of-wp-files/ -type d -exec chmod 755 {} \;
Restricting Database User Privileges
We should only give privileges like SELECT, INSERT, DROP to specific database users that needed for WordPress users.
Securing wp-includes folder
WP-INCLUDES is the folder where the core files and scripts of WordPress stored. If you don’t want to allow access of scripts to any user then you can use htaccess rule to block access to the wp-includes folder.
<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>
Securing wp-config.php file
WP-CONFIG.PHP is the file where the main configuration of WordPress is stored. The wp-config.php file should have the correct permission, otherwise, there is the chance of moving the file or accessing it and it will lead to the security issue. To secure it, add the below rule in htaccess
<files wp-config.php>
order allow,deny
deny from all
</files>
These are the main points to be covered to secure WordPress websites and many more techniques are available. If you need to harden your server with WordPress website, please ping our team and our experts will get it done within a short time.