{"id":9060,"date":"2020-02-24T10:25:10","date_gmt":"2020-02-24T10:25:10","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=9060"},"modified":"2026-03-16T18:48:45","modified_gmt":"2026-03-16T13:18:45","slug":"learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/","title":{"rendered":"Learn to Deny Access to Your wp-config.php File Under WordPress Installation"},"content":{"rendered":"<p>Is your wp-config.php file secure? You can deny access to this file by following simple steps.<\/p>\n<h3>Steps to Deny Access to Your wp-config.php File Under WordPress Installation<\/h3>\n<ol>\n<li>You will find your wp-config.php in the main directory of your WordPress installation and it is used to access the database.<\/li>\n<li>In this file comprises of your user id, password and database name in unencrypted format.<\/li>\n<li>Though it might be a .php file and no one should be able to see its content from the browser, you shouldn\u2019t keep it in the main folder without doing anything about it.<\/li>\n<li>.htaccess in WordPress is commonly used to setup custom permalink for better SEO optimization. But you can utilize .htaccess to minimize vulnerability of your site.<\/li>\n<li>It is good to update your .htaccess to deny access to it. Here, files directive can be used to deny access to certain files. This directive can be used for any file on your website.<\/li>\n<li>Simply add the below code to your .htaccess present under the www directory:<\/li>\n<\/ol>\n<pre class=\"lang:default decode:true \"># to protect wp-config.php\r\n&lt;Files wp-config.php&gt;\r\norder allow,deny\r\ndeny from all\r\n&lt;\/Files&gt;<\/pre>\n<p>Here \u201cdeny all\u201d will deny the access to wp-config.php for all.<\/p>\n<p><strong>Also Read:<\/strong><br \/>\n<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/about-wp-config-php\/\" target=\"_blank\" rel=\"noopener\"><strong>Everything You Need to Know About wp-config.php<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is your wp-config.php file secure? You can deny access to this file by following simple steps. Steps to Deny Access to Your wp-config.php File Under WordPress Installation You will find your wp-config.php in the main directory of your WordPress installation and it is used to access the database. In this file comprises of your user [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3083],"tags":[1301,78,880,879],"class_list":["post-9060","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-security","tag-deny-access-to-wp-config-php","tag-wordpress-2","tag-wordpress-files","tag-wp-config-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learn to Deny Access to Your wp-config.php File Under WordPress Installation<\/title>\n<meta name=\"description\" content=\"Have you restricted the access to your wp-config.php file? Follow the steps to deny access your wp-config.php file under WordPress installation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn to Deny Access to Your wp-config.php File Under WordPress Installation\" \/>\n<meta property=\"og:description\" content=\"Have you restricted the access to your wp-config.php file? Follow the steps to deny access your wp-config.php file under WordPress installation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-24T10:25:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-16T13:18:45+00:00\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\"},\"author\":{\"name\":\"Pallavi Godse\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"headline\":\"Learn to Deny Access to Your wp-config.php File Under WordPress Installation\",\"datePublished\":\"2020-02-24T10:25:10+00:00\",\"dateModified\":\"2026-03-16T13:18:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\"},\"wordCount\":207,\"commentCount\":0,\"keywords\":[\"deny access to wp-config.php\",\"WordPress\",\"wordpress files\",\"wp-config.php\"],\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\",\"name\":\"Learn to Deny Access to Your wp-config.php File Under WordPress Installation\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2020-02-24T10:25:10+00:00\",\"dateModified\":\"2026-03-16T13:18:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"Have you restricted the access to your wp-config.php file? Follow the steps to deny access your wp-config.php file under WordPress installation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn to Deny Access to Your wp-config.php File Under WordPress Installation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn to Deny Access to Your wp-config.php File Under WordPress Installation","description":"Have you restricted the access to your wp-config.php file? Follow the steps to deny access your wp-config.php file under WordPress installation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/","og_locale":"en_US","og_type":"article","og_title":"Learn to Deny Access to Your wp-config.php File Under WordPress Installation","og_description":"Have you restricted the access to your wp-config.php file? Follow the steps to deny access your wp-config.php file under WordPress installation.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2020-02-24T10:25:10+00:00","article_modified_time":"2026-03-16T13:18:45+00:00","author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/"},"author":{"name":"Pallavi Godse","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"headline":"Learn to Deny Access to Your wp-config.php File Under WordPress Installation","datePublished":"2020-02-24T10:25:10+00:00","dateModified":"2026-03-16T13:18:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/"},"wordCount":207,"commentCount":0,"keywords":["deny access to wp-config.php","WordPress","wordpress files","wp-config.php"],"articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/","name":"Learn to Deny Access to Your wp-config.php File Under WordPress Installation","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2020-02-24T10:25:10+00:00","dateModified":"2026-03-16T13:18:45+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"Have you restricted the access to your wp-config.php file? Follow the steps to deny access your wp-config.php file under WordPress installation.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/learn-to-deny-access-to-your-wp-config-php-file-under-wordpress-installation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Learn to Deny Access to Your wp-config.php File Under WordPress Installation"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/9060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=9060"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/9060\/revisions"}],"predecessor-version":[{"id":9061,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/9060\/revisions\/9061"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=9060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=9060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=9060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}