{"id":4839,"date":"2020-05-13T08:23:23","date_gmt":"2020-05-13T08:23:23","guid":{"rendered":"https:\/\/www.johnthornhill.com\/blog\/?p=4839"},"modified":"2020-05-13T15:30:09","modified_gmt":"2020-05-13T15:30:09","slug":"secure-your-wordpress-site","status":"publish","type":"post","link":"https:\/\/www.johnthornhill.com\/blog\/secure-your-wordpress-site\/","title":{"rendered":"Secure Your WordPress Site"},"content":{"rendered":"<p>WordPress is a very popular website creation tool. It can be used to create anything from a simple blog to a full-blown e-commerce site. <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-4840\" src=\"https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash.jpg?resize=200%2C300&#038;ssl=1\" alt=\"\" width=\"200\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?resize=200%2C300&amp;ssl=1 200w, https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?resize=683%2C1024&amp;ssl=1 683w, https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?resize=768%2C1152&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?resize=1024%2C1536&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?resize=1365%2C2048&amp;ssl=1 1365w, https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?w=1707&amp;ssl=1 1707w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/p>\n<p>Because of that, it is the most dominant CMS (Content Management System) on the market. According to a survey, 35% of all websites (62% of CMS websites) &#8211; or around 455,000,000 websites are using WordPress.<\/p>\n<p>This is great for you, it means that there is a lot of support and plenty of plugins (addons) available &#8211; often free.<\/p>\n<p>At the same time, it could be a problem for you. It is the most attacked type of system on the web. Anybody using WordPress must use a security plugin.<\/p>\n<p>The one that I use &#8211; and have been using for a number of years on sites that I have built &#8211; is <a href=\"https:\/\/en-gb.wordpress.org\/plugins\/better-wp-security\/\" target=\"_blank\" rel=\"noopener noreferrer\">iThemes Security<\/a> previously known as Better WordPress Security. According to the <a href=\"https:\/\/bloggersroadmap.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Bloggers Roadmap<\/a>, &#8220;iThemes Security is the best overall security plugin you can find&#8221;. Although there is a paid version, the free version does an excellent job.<\/p>\n<p>In this post, I will take you through the options and configurations of the free version.<\/p>\n<p>The first thing you should do after installing and activating the plugin is to run the security check.<\/p>\n<p><strong>This will enable and initially configure:-<\/strong><br \/>\n&#8211; Banned Users<br \/>\n&#8211; Database Backups<br \/>\n&#8211; Local Brute Force Protection<br \/>\n&#8211; Network Brute Force Protection<br \/>\n&#8211; Strong Passwords<br \/>\n&#8211; WordPress Tweaks<\/p>\n<p>You then have basic protection &#8211; from a single click of a button.<\/p>\n<p>Now it&#8217;s time to visit the various modules to really tighten thing up by checking (and possibly changing) the following configurations<\/p>\n<p><strong>Global Settings<\/strong><\/p>\n<p>The configuration that I use is as follows:<br \/>\nAllow iThemes Security to write to wp-config.php and .htaccess &#8211; this will ensure that your security settings are always properly updated.<\/p>\n<p>The three lockout messages can be left as standard, or you can enter your own.<\/p>\n<p>Enable Blacklist Repeat Offender &#8211; people who fail blacklist checks several times are automatically added to the banned list. I use these thresholds: Permanently Ban after 3 lockouts within 21 days, Lockout Period 15 minutes (before they can retry).<\/p>\n<p>Lockout Whitelist: Enter\u00a0Your own IP address &#8211; done automatically if you click the button.\u00a0 This is very important &#8211; it means that you cannot accidentally be blacklisted from your own site.<\/p>\n<p>You may need to update this periodically if your internet provider changes your address &#8211; I am on a cable service and have had the same IP address for a few years.<\/p>\n<p><strong>Notification Center<\/strong><br \/>\nHere you can configure notification of security warnings<\/p>\n<p><strong>User Groups<\/strong><br \/>\nCan be left at the defaults<\/p>\n<p><strong>404 Detection<\/strong><br \/>\nThis catches people looking for files to exploit. 404 (not found) errors are shown when a requested file is not found on your system. I set &#8216;Remember 404 Error&#8217; to 15 minutes and &#8216;Error Threshold&#8217; to 5. I leave the &#8216;Whitelist&#8217; and &#8216;Ignored File Types&#8217; as is.<\/p>\n<p><strong>Away mode<\/strong><br \/>\nI don&#8217;t enable this but it can be used to disable WordPress dashboard access at certain times.<\/p>\n<p><strong>Banned users<\/strong><br \/>\n&#8211; Here you can give a list of IP addresses or address blocks to ban completely.<br \/>\n&#8211; Enable HackRepair.com&#8217;s blacklist feature.<br \/>\n&#8211; Enable Ban Lists<br \/>\n&#8211; Ban Hosts. I tend to use the lockout notifications (especially for people trying to log in as Admin) to block the whole ISP for hackers from places like Russia, China etc.<\/p>\n<p>If you need help with this, ask via comments and I will add a short explanatory post<\/p>\n<p><strong>Database Backups<\/strong><\/p>\n<p>Configure your backups. I use the following:<br \/>\n&#8211; Backup Full Database Off<br \/>\n&#8211; Backup Method Email Only &#8211; backups will be emailed to me<br \/>\n&#8211; Backups to Retain doesn&#8217;t matter as I am not storing them on the machine<br \/>\n&#8211; Zip Database Backups<br \/>\n&#8211; Exclude Tables I leave as is<br \/>\n&#8211; Enable Scheduled Database Backups<br \/>\n&#8211; Backup Interval 3 days (if your site is very busy, with many posts, you may wish to shorten this interval).<\/p>\n<p><strong>File Change Detection<\/strong><br \/>\nI leave this as is, but you can choose not to flag changes to some files, or to include some of the exclude file types.<\/p>\n<p><strong>File Permissions<\/strong><br \/>\nThis will give the current and recommended permissions for various files. If the site is working a lower level than recommended doesn&#8217;t hurt, but they need some explanation.<\/p>\n<p>Assuming a Linux host (the most common) each file or folder has 3 sets of permissions:<br \/>\n&#8211; What the owner of the file can do<br \/>\n&#8211; What people in the same group of users as the owner can do<br \/>\n&#8211; What anyone else can do.<\/p>\n<p>These permissions are represented as 3 numbers in the order owner, group member, anyone else.<\/p>\n<p>The numbers have the following meaning.<br \/>\n0 can do nothing<br \/>\n1 can enter the folder or execute the program (e.g. a php file)<br \/>\n2 can write to the file (or folder)<br \/>\n3 can write to the file (or folder) and can enter the folder or execute the program (e.g. a php file)<br \/>\n4 can read the file (or folder)<br \/>\n5 can read the file (or folder) and can enter the folder or execute the program (e.g. a php file)<br \/>\n6 can read or write to the file (or folder)<br \/>\n7 can read or write to the file (or folder) and can enter the folder or execute the program (e.g. a php file)<\/p>\n<p><strong>Local Brute Force Protection<\/strong><br \/>\nThis is to protect against those who attempt to break in by guessing passwords.<br \/>\nNote: Set yourself up as an administrator, set up another user as an editor, remove the user &#8216;admin&#8217; (if present), and never post using your admin login. If you have posted with this name you can choose quick edit for the post and change the author.<\/p>\n<p>I set Max Login Attempts Per Host and Max Login Attempts Per User to 5<br \/>\nI set Minutes to Remember Bad Login (check period) to 15 minutes (some hackers anticipate the normal 10 minute period)<br \/>\nAlways set Automatically Ban &#8220;admin&#8221; user<\/p>\n<p><strong>Network Brute Force Protection<\/strong><br \/>\nmake sure that you have generated an API key and selected Automatically ban IPs reported as a problem by the network<\/p>\n<p><strong>Password Requirements<\/strong><br \/>\nEnable strong passwords for Administrator and Editor. You can also enable for lower categories if you wish.<\/p>\n<p><strong>SSL<\/strong><br \/>\nLeave unless you have a security certificate to run your site under https<\/p>\n<p><strong>System Tweaks<\/strong><\/p>\n<p>More advanced settings. I recommended<br \/>\nProtect System Files<br \/>\nDisable Directory Browsing<br \/>\nDisable PHP in Uploads<\/p>\n<p><strong>WordPress Salts<\/strong><br \/>\nI leave this alone<\/p>\n<p><strong>WordPress Tweaks<\/strong><\/p>\n<p>I enable the following:<br \/>\n&#8211; Reduce Comment Spam<br \/>\n&#8211; Disable File Editor It says that if you enable this you will need to manually edit theme and other files using a tool other than WordPress, but you can disable this and re-enable after editing.<br \/>\n&#8211; XML-RPC You can set this to disabled. If you use jetpack you will need it enabled, and follow the jetpack security settings.<br \/>\n&#8211; Block Multiple Authentication Attempts per XML-RPC Request.<br \/>\n&#8211; REST API is the better, newer replacement for XML-RPC. Use the recommended Restricted Access.<br \/>\n&#8211; Disable login error messages.<br \/>\n&#8211; Force users to choose a unique nickname &#8211; makes the displayed post name different from the login name. This would allow you to post as administrator user but I still recommend that you don&#8217;t<br \/>\n&#8211; Prevent attachment thumbnails from traversing to other files.<\/p>\n<p>Once this is done your WordPress site will be quite strongly protected.<\/p>\n<p>Let me know if this post was helpful. Your comments or corrections are always welcome.<\/p>\n<p>If you would like to see my progress from internet nerd to internet marketer visit <a href=\"http:\/\/thegotomarketer.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">thegotomarketer.net<\/a><\/p>\n<p>Norman Hull &#8211; <a href=\"http:\/\/thegotomarketer.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">thegotomarketer.net\/<\/a><\/p>\n<p><em>This is a guest post from Norman Hull, if you would like to be considered for a guest post please contact me.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is a very popular website creation tool. It can be used to create anything from a simple blog to a full-blown e-commerce site. Because of that, it is the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":4840,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[40,15],"tags":[],"class_list":["post-4839","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-guest-posts"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.johnthornhill.com\/blog\/wp-content\/uploads\/2020\/05\/john-salvino-bqGBbLq_yfc-unsplash-scaled.jpg?fit=1707%2C2560&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2rQRH-1g3","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/posts\/4839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/comments?post=4839"}],"version-history":[{"count":2,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/posts\/4839\/revisions"}],"predecessor-version":[{"id":4842,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/posts\/4839\/revisions\/4842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/media\/4840"}],"wp:attachment":[{"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/media?parent=4839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/categories?post=4839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johnthornhill.com\/blog\/wp-json\/wp\/v2\/tags?post=4839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}