{"id":36901,"date":"2016-10-12T17:42:43","date_gmt":"2016-10-12T14:42:43","guid":{"rendered":"https:\/\/tuthost.ua\/faq\/how-do-i-protect-the-wordpress-admin-area\/"},"modified":"2024-07-19T23:04:37","modified_gmt":"2024-07-19T20:04:37","slug":"kak-zashchitit-adminku-wordpress","status":"publish","type":"ht_kb","link":"https:\/\/tuthost.ua\/en\/faq\/kak-zashchitit-adminku-wordpress\/","title":{"rendered":"How do I protect the Wordpress admin area?"},"content":{"rendered":"\n<p>Recently, attacks on WordPress with the goal of stealing passwords have become very frequent. Attackers are requesting access to the file wp-login.php, respectively, the simplest method of protection would be to deny them all access to this file.<\/p>\n\n<p>There are several ways to do this:<\/p>\n\n<p>1) <strong>Close the file .htaccess for all IP addresses<\/strong><\/p>\n\n<p>In the file .htaccess you need to write<\/p>\n\n<p><\/p>\n\n<pre class=\"wp-block-code\"><code>&lt;Files wp-login.php&gt;\norder deny,allow\ndeny from all\nallow from 1.2.3.4\n&lt;\/Files&gt;<\/code><\/pre>\n\n<p>What it means:<\/p>\n\n<p>&lt;Files wp-login.php&gt; &#8211; Rule for file wp-login.php order deny,allow &#8211; Defines the logic of work.<br\/>deny from all &#8211; Deny everyone to view files.<br\/>allow from 1.2.3.4 &#8211; Allow access to file wp-login.php for ip address 1.2.3.4<\/p>\n\n<p>You need to replace the address 1.2.3.4 with your IP address, which can be found here: <a href=\"https:\/\/tuthost.ua\/en\/ip\/\">https:\/\/tuthost.ua\/ip\/<\/a> or <a href=\"https:\/\/2ip.ua\/\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/2ip.ua<\/a> <br\/>However, keep in mind that if your ISP does not give you a static address, then it will be constantly changing.<\/p>\n\n<p><strong>2) The second way is to rename the file wp-login.php<\/strong><\/p>\n\n<p><strong>1.<\/strong> Rename the original wp-login.php to any other name, even to &#8220;4xqtbgkqs60.php&#8221;.<\/p>\n\n<p><strong>2.<\/strong> Then replace all the words <em>wp-login.php<\/em> with the new name, in our case <em>4xqtbgkqs60.php<\/em>, in the file 4xqtbgkqs60<em>.php (old wp-login.php) and <\/em>in the file <em>wp-includes\/general-template.php<\/em>.<\/p>\n\n<p><strong>3.<\/strong> The final step is to completely restrict access to the file wp-login.php in .htaccess:<\/p>\n\n<pre class=\"wp-block-code\"><code>&lt;Files wp-login.php&gt;\nOrder Deny,Allow\nDeny from all\n&lt;\/Files&gt;<\/code><\/pre>\n\n<p>Lock access to a non-existent file wp-login.php is necessary because intruders will still be asking for it, and the engine will issue a 404 page (the file does not exist), which also creates a large load on the site.<\/p>\n\n<p><strong>Note, <\/strong>if you create a <strong>deny from all<\/strong> construct, make sure you have a <strong>403.shtml<\/strong> file in the root of your site, if not, then create one. Otherwise, requests for error 403 will intercept wordpress and in this case the load on the site will not decrease.<\/p>\n<div class=\"gb-button-wrapper gb-button-wrapper-994441ca\">\n\n<a class=\"gb-button gb-button-abe26a49 gb-button-yellow-button\" href=\"https:\/\/tuthost.ua\/en\/hosting\/wordpress\/\"><span class=\"gb-icon\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"32\" height=\"60\" viewbox=\"0 0 32 32\" class=\"svg\">\n<title>select<\/title>\n<path fill=\"currentColor\" d=\"M14.9 8.363h-5.906c-0.231 0-0.425-0.188-0.425-0.425v-5.906c0-0.231 0.188-0.425 0.425-0.425h5.906c0.231 0 0.425 0.188 0.425 0.425v5.906c0 0.231-0.188 0.425-0.425 0.425zM9.412 7.513h5.063v-5.063h-5.063v5.063z\"><\/path>\n<path d=\"M14.9 19.356h-5.65c-0.231 0-0.425-0.188-0.425-0.425s0.188-0.425 0.425-0.425h5.231v-5.063h-5.063v2.106c0 0.231-0.188 0.425-0.425 0.425s-0.425-0.188-0.425-0.425v-2.531c0-0.231 0.188-0.425 0.425-0.425h5.906c0.231 0 0.425 0.188 0.425 0.425v5.919c0 0.231-0.188 0.419-0.425 0.419z\"><\/path>\n<path fill=\"currentColor\" d=\"M14.9 30.356h-5.906c-0.231 0-0.425-0.188-0.425-0.425v-5.906c0-0.231 0.188-0.425 0.425-0.425h5.906c0.231 0 0.425 0.188 0.425 0.425v5.906c0 0.238-0.188 0.425-0.425 0.425zM9.412 29.512h5.063v-5.063h-5.063v5.063z\"><\/path>\n<path fill=\"currentColor\" d=\"M31.137 3.675h-13.5c-0.231 0-0.425-0.188-0.425-0.425 0-0.231 0.188-0.425 0.425-0.425h13.506c0.231 0 0.425 0.188 0.425 0.425-0.006 0.237-0.194 0.425-0.431 0.425z\"><\/path>\n<path fill=\"currentColor\" d=\"M27.8 6.287h-10.125c-0.231 0-0.425-0.188-0.425-0.425s0.188-0.425 0.425-0.425h10.131c0.231 0 0.425 0.188 0.425 0.425s-0.194 0.425-0.431 0.425z\"><\/path>\n<path d=\"M31.137 14.912h-13.5c-0.231 0-0.425-0.188-0.425-0.425s0.188-0.425 0.425-0.425h13.506c0.231 0 0.425 0.188 0.425 0.425s-0.194 0.425-0.431 0.425z\"><\/path>\n<path d=\"M27.8 17.525h-10.125c-0.231 0-0.425-0.188-0.425-0.425s0.188-0.425 0.425-0.425h10.131c0.231 0 0.425 0.188 0.425 0.425s-0.194 0.425-0.431 0.425z\"><\/path>\n<path fill=\"currentColor\" d=\"M31.137 26.156h-13.5c-0.231 0-0.425-0.188-0.425-0.425s0.188-0.425 0.425-0.425h13.506c0.231 0 0.425 0.188 0.425 0.425s-0.194 0.425-0.431 0.425z\"><\/path>\n<path fill=\"currentColor\" d=\"M27.762 28.762h-10.125c-0.231 0-0.425-0.188-0.425-0.425s0.188-0.425 0.425-0.425h10.131c0.231 0 0.425 0.188 0.425 0.425s-0.194 0.425-0.431 0.425z\"><\/path>\n<path fill=\"currentColor\" d=\"M7.025 25.050c-0.006 0-0.019 0-0.025 0-0.188-0.012-0.344-0.15-0.381-0.331l-1.037-4.762-4.763-1.038c-0.181-0.038-0.319-0.194-0.331-0.381s0.1-0.363 0.275-0.425l9.613-3.5c0.156-0.056 0.325-0.019 0.444 0.1s0.156 0.287 0.1 0.444l-3.494 9.619c-0.069 0.163-0.225 0.275-0.4 0.275zM2.413 18.4l3.6 0.788c0.162 0.038 0.287 0.163 0.325 0.319l0.787 3.6 2.688-7.4-7.4 2.694z\"><\/path>\n<\/svg><\/span><span class=\"gb-button-text\">Hosting for WordPress<\/span><\/a>\n\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Recently, attacks on WordPress with the goal of stealing passwords have become very frequent. Attackers are requesting access to the file wp-login.php, respectively, the simplest method of protection would be to deny them all access to this file. There are several ways to do this: 1) Close the file .htaccess for all IP addresses In&#8230;<\/p>\n","protected":false},"author":4,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","ghostkit_customizer_options":"","ghostkit_custom_css":"","ghostkit_custom_js_head":"","ghostkit_custom_js_foot":"","ghostkit_typography":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"ht-kb-category":[10702],"ht-kb-tag":[],"class_list":["post-36901","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-general-questions"],"taxonomy_info":{"ht_kb_category":[{"value":10702,"label":"General Questions"}]},"featured_image_src_large":[],"author_info":{"display_name":"\u041e\u043b\u0435\u0433 \u041f\u043e\u043a\u043e\u0442\u0438\u043b\u043e","author_link":"https:\/\/tuthost.ua\/en\/author\/oleg-tuthost-com\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/36901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/comments?post=36901"}],"version-history":[{"count":2,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/36901\/revisions"}],"predecessor-version":[{"id":52389,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/36901\/revisions\/52389"}],"wp:attachment":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/media?parent=36901"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb-category?post=36901"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=36901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}