{"id":1351,"date":"2011-02-20T17:59:02","date_gmt":"2011-02-20T23:59:02","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=1351"},"modified":"2012-08-14T18:09:11","modified_gmt":"2012-08-14T23:09:11","slug":"how-to-protect-and-secure-wordpress","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/how-to-protect-and-secure-wordpress\/","title":{"rendered":"How to protect and secure WordPress"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1366\" data-permalink=\"https:\/\/icesquare.com\/wordpress\/how-to-protect-and-secure-wordpress\/wordpress-security\/#main\" data-orig-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security.jpg\" data-orig-size=\"410,410\" data-comments-opened=\"1\" data-image-title=\"How to secure your wordpress site\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security.jpg\" src=\"\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-150x150.jpg\" title=\"How to secure your wordpress site\" width=\"150\" height=\"150\" class=\"alignleft size-thumbnail wp-image-1366\" srcset=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-150x150.jpg 150w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-300x300.jpg 300w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-177x177.jpg 177w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-35x35.jpg 35w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-164x164.jpg 164w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security-185x185.jpg 185w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/02\/wordpress-security.jpg 410w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/p>\n<p>Securing a WordPress blog is pretty simple. If you google the words &#8220;How to protect wordpress&#8221;, you will find a lot of sites talk about the basic techniques, such as<\/p>\n<ol>\n<li>Make sure that your WordPress software and other plugins are always up to date<\/li>\n<li>Enable Akismet to protect your site from spam comment<\/li>\n<li>Don&#8217;t share your WordPress account with others people<\/li>\n<\/ol>\n<p>While these advices are absolutely correct, but to me (and most other experienced users), these are common sense only. As an advanced user, I am interested in learning more innovative or advanced techniques, rather than some junk collected from <strong>WordPress for Dummies<\/strong>.<\/p>\n<p>In the following paragraphs, I am going to show you some advanced techniques that 90% of the WordPress sites have not implemented. They are nothing fancy, just require you to do tweak using terminal. Notice that doing something through terminal (a.k.a. command line) is considered an difficult task to 90% of the people in the world.<\/p>\n<p>Anyway, the techniques I introduce below are targeted to solve the most basic and fundamental security problem that WordPress do not address, because these problems go beyond its capability.<\/p>\n<h2>Securing WordPress: Step 1 &#8211; Secure your server, at least secure how you login to WordPress Dashboard<\/h2>\n<p>WordPress provides an extremely easy way to access the WordPress Dashboard:<\/p>\n<pre>http:\/\/yourwordpress.com\/wordpress\/wp-login.php<\/pre>\n<p>It is very handy because you can log in to your website anywhere, as long as you have access to a browser with internet connection. However, it also opens a door to everybody as long as they have your login and password. How? When you login to WordPress, you are sending your login and password to the WordPress server in clear, unencrypted format. Everything are visible to everybody. If someone is interested to steal your information, it is possible.<\/p>\n<p>There are two ways to solve this problem &#8211;<\/p>\n<p>1.) Building a secure HTTP server, i.e.,<\/p>\n<pre>https:\/\/yourwordpress.com<\/pre>\n<p>Notice that it is https, not just http.<\/p>\n<p>Depending on what web server you use to run WordPress. In my case, I use Apache and it is very simple to run a secure Apache server. All I need is to generate a website certificate, apply it to my domain and my secure web server is ready.<\/p>\n<p>There is only one problem &#8211; All browsers will complain about your certificate because it is generated by myself, not the other authorities such as Verisign. However, I can ask my browser to ignore that.<\/p>\n<p>If it sounds difficult to you, you can ignore that. The second suggestion below will help solving this problem.<\/p>\n<h2>Securing WordPress: Step 2 &#8211; Limit the access to WordPress Dashboard<\/h2>\n<p>Okay, now you&#8217;ve already secure the communication channel between your computer and the WordPress server, and no one can see the login and password in your transaction. Is it enough? Nope. I can still brute-force attack your website by trying all different combination. So, we need to limit the access by IP addresses. Depending on how you access your WordPress blog, if you always access it from certain location, such as home, office or other locations, and if these IP addresses do not change often, this may work for you.<\/p>\n<p>Simply go to the wordpress directory, e.g.,<\/p>\n<pre>\/usr\/local\/www\/wordpress<\/pre>\n<p>Make sure that <strong>.htaccess<\/strong> exists.<\/p>\n<p>Add the following to the end of the file:<\/p>\n<pre>order deny,allow\r\ndeny from all\r\nallow from XXX.XXX.XXX.XXX\r\nallow from localhost\r\n<\/pre>\n<p>Replace XXX.XXX.XXX.XXX by your IP addresses. Here are some examples:<\/p>\n<pre>allow from 192.168.1.101  #Allow from this address\r\nallow from 192.168.1        #Allow from 192.168.1.*\r\nallow from 192.168          #Allow from 192.168.*.*\r\n<\/pre>\n<p>That&#8217;s it! If you want to go further, you can check the IP address inside wp-login.php as well, i.e.,<\/p>\n<pre>$IP = $_SERVER['REMOTE_ADDR'];\r\n\r\nif ($IP != '192.168.1.100') exit();\r\n<\/pre>\n<p>However, I don&#8217;t recommend this way because your codes will get overwritten after upgrading the WordPress.<\/p>\n<p>That&#8217;s it. Enjoy building a secure WordPress site.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Securing a WordPress blog is pretty simple. If you google the words &#8220;How to protect wordpress&#8221;, you will find a lot of sites talk about the basic techniques, such as <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/how-to-protect-and-secure-wordpress\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,144,6,69],"tags":[82,67],"class_list":["post-1351","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","category-troubleshooting-technology","tag-security","tag-wordpress"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-lN","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":896,"url":"https:\/\/icesquare.com\/wordpress\/finally-ubuntu-uses-a-more-updated-linux-kernel-than-fedora\/","url_meta":{"origin":1351,"position":0},"title":"Finally, Ubuntu uses a more updated Linux kernel than Fedora","author":"Derrick","date":"October 11, 2010","format":false,"excerpt":"Historically, Ubuntu focuses on the user experience such as beautiful graphical user interface, while Fedora focuses on performance. In the other words, the kernel in Fedora distribution is more up-to-dated. I just upgraded by Ubuntu 10.04 to 10.10 (released on October 10, 2010), I found that the Linux Kernel in\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2602,"url":"https:\/\/icesquare.com\/wordpress\/say-no-to-sopa-pipa\/","url_meta":{"origin":1351,"position":1},"title":"Say NO to SOPA\/PIPA","author":"Derrick","date":"January 18, 2012","format":false,"excerpt":"Everyday, many people from US and other countries find their solutions here to solve their computer problem through the search engine. If the Stop Online Piracy Act (SOPA) and Protect Intellectual Property Act (PIPA) are passed, it simply allows US government to censor the web. Someday, IceSquare may be blocked\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2976,"url":"https:\/\/icesquare.com\/wordpress\/lightroom-photomatix-lightroom-rendition-failed\/","url_meta":{"origin":1351,"position":2},"title":"[Adobe Lightroom \/ Photomatix]Lightroom rendition failed","author":"Derrick","date":"October 1, 2012","format":false,"excerpt":"Yesterday, I was processing some of the pictures in Adobe Lightroom. I liked to export few of them to Photomatix for HDR processing. Then, the system complained with this error message: Lightroom rendition failed After searching this error message on Google, I found that this message was generated by the\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2012\/10\/Temp-271x300.png","width":350,"height":200},"classes":[]},{"id":923,"url":"https:\/\/icesquare.com\/wordpress\/freebsd-or-linux\/","url_meta":{"origin":1351,"position":3},"title":"FreeBSD or Linux in 6 Simple Questions","author":"Derrick","date":"February 18, 2016","format":false,"excerpt":"FreeBSD or Linux FreeBSD or Linux (Ubuntu\/RHEL)? This is a very old question. It's like asking iPhone or Android. There is no short answer. It all depends on your situation. To make things easier, I am going to break it down into six simple questions to help you making decision.\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3412,"url":"https:\/\/icesquare.com\/wordpress\/how-to-remote-desktop-to-linux-from-windows-xrdp\/","url_meta":{"origin":1351,"position":4},"title":"How to Remote Desktop To Linux From Windows Using XRDP","author":"Derrick","date":"January 24, 2014","format":false,"excerpt":"If you are looking for ways to remote desktop to Linux from Windows, and you are sick of VNC, you are in the right place. I have been looking for a solution to do something very simple. I want to remotely access the desktop of my Linux servers from Windows\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1214,"url":"https:\/\/icesquare.com\/wordpress\/building-a-super-large-and-reliable-file-server-with-mixed-size-of-harddisks\/","url_meta":{"origin":1351,"position":5},"title":"Building a Super Large and Reliable File Server with Mixed Size of Harddisks","author":"Derrick","date":"January 17, 2011","format":false,"excerpt":"In this article, I am going to show you how to build a super large, ultra reliable, expandable file server with mixed size of hard drives. Here is my criteria: Large Storage Capacity. At this moment, the largest hard drive is 2TB. I am looking for at least 10TB. Great\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/01\/zfs_logo-150x150.jpg","width":350,"height":200},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1351"}],"version-history":[{"count":21,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1351\/revisions"}],"predecessor-version":[{"id":2876,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1351\/revisions\/2876"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}