{"id":1158,"date":"2018-07-04T17:55:27","date_gmt":"2018-07-04T17:55:27","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=article&#038;p=1158"},"modified":"2024-10-16T09:42:46","modified_gmt":"2024-10-16T09:42:46","slug":"how-to-disable-php-execution-in-wordpress-directories","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/how-to-disable-php-execution-in-wordpress-directories\/","title":{"rendered":"How to Disable PHP Execution in WordPress Directories"},"content":{"rendered":"<p>Most of the times, hacked WordPress sites usually have backdoor files. These backdoor files are often disguised as core WordPress files and are placed in\u00a0<strong>\/wp-includes\/<\/strong>\u00a0or\u00a0<strong>\/wp-content\/uploads\/<\/strong>folders.<\/p>\n<p>An easy way to improve your <a href=\"https:\/\/chemicloud.com\/blog\/wordpress-security\/\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress security<\/a> is by disabling PHP execution for some WordPress directories.<\/p>\n<h3 id=\"how-to-disable-php-execution-in-wordpress-directories\">How to Disable PHP Execution in WordPress Directories<\/h3>\n<p>Create a blank .htaccess file and paste this code inside it:<\/p>\n<div class=\"EnlighterJSWrapper enlighterEnlighterJSWrapper\">\n<pre><span class=\"\">&lt;Files *.php&gt;<\/span>\r\n<span class=\"\">deny from all<\/span>\r\n<span class=\"\">&lt;\/Files&gt;<\/span><\/pre>\n<\/div>\n<p>Then upload this file to <strong>\/wp-content\/uploads\/<\/strong> and <strong>\/wp-includes\/<\/strong> directories.<\/p>\n<p><strong>That&#8217;s it!<\/strong><\/p>\n    \t\t<div class=\"hts-messages hts-messages--info    \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tIf you enjoyed this tutorial, then you\u2019ll love our support. All ChemiCloud\u2019s hosting plans include 24\/7 support from our amazing support team.<\/p>\n<p class=\"p1\">Check out our <a href=\"https:\/\/chemicloud.com\/managed-wordpress-hosting?utm_source=blog&amp;utm_medium=article#60b65e4e63b58\"><span class=\"s1\">Managed WordPress hosting<\/span><\/a>\u00a0plans and have your website migrated today!<\/p>\n    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n","protected":false},"excerpt":{"rendered":"<p>Most of the times, hacked WordPress sites usually have backdoor files. These backdoor files are often disguised as core WordPress files and are placed in\u00a0\/wp-includes\/\u00a0or\u00a0\/wp-content\/uploads\/folders. An easy way to improve your WordPress security is by disabling PHP execution for some WordPress directories. How to Disable PHP Execution in WordPress Directories&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[40],"ht-kb-tag":[],"class_list":["post-1158","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/1158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=1158"}],"version-history":[{"count":5,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/1158\/revisions"}],"predecessor-version":[{"id":8503,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/1158\/revisions\/8503"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=1158"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=1158"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=1158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}