{"id":9467,"date":"2026-06-02T19:27:27","date_gmt":"2026-06-02T17:27:27","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9467"},"modified":"2026-06-08T09:27:15","modified_gmt":"2026-06-08T07:27:15","slug":"cum-sa-dezactivati-lista-de-directoare-in-wordpress","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/","title":{"rendered":"Cum s\u0103 dezactiva\u021bi listarea \u00een directoare \u00een WordPress"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">If you want to prevent visitors from seeing a list of files inside a directory on your website, you can disable directory listing using a rule in the <code>.htaccess<\/code> file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is useful for improving security and preventing exposure of sensitive files.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/#What_is_directory_listing\" >What is directory listing?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/#How_to_disable_directory_listing\" >How to disable directory listing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/#Where_to_add_this_rule\" >Where to add this rule<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/#How_it_works\" >How it works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/#Important_notes\" >Important notes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-disable-directory-listing-in-wordpress\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_directory_listing\"><\/span>What is directory listing?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-1061880052\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">By default, if a directory does not contain an index file (like <code>index.php<\/code> or <code>index.html<\/code>), the server may display a list of all files inside that folder. This can expose internal files and structure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_disable_directory_listing\"><\/span>How to disable directory listing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To turn off directory listing, add the following rule to your <code>.htaccess<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Options -Indexes<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_to_add_this_rule\"><\/span>Where to add this rule<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your website files via FTP<\/li>\n\n\n\n<li>Locate the <code>.htaccess<\/code> file in your WordPress root directory<\/li>\n\n\n\n<li>Add the rule at the end of the file<\/li>\n\n\n\n<li>Save the changes<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_it_works\"><\/span>How it works<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once enabled:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Users will no longer see file listings in empty directories<\/li>\n\n\n\n<li>Accessing a folder without an index file will return a \u201c403 Forbidden\u201d or similar error<\/li>\n\n\n\n<li>Directory structure and file names are hidden from public view<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Important_notes\"><\/span>Important notes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This rule affects the entire directory where it is placed and all subdirectories<\/li>\n\n\n\n<li>WordPress already uses this rule in many default <code>.htaccess<\/code> configurations<\/li>\n\n\n\n<li>It is a lightweight and recommended security practice for most websites<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Adding <code>Options -Indexes<\/code> to your <code>.htaccess<\/code> file is a simple and effective way to prevent directory browsing and improve the security of your WordPress installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[125],"manual_kb_tag":[767,914,1626,5210,5211,5213,5215,5403,429,718],"class_list":["post-9467","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-websites","manual_kb_tag-web-server","manual_kb_tag-website-security","manual_kb_tag-htaccess","manual_kb_tag-directory-listing","manual_kb_tag-disable-directory-listing","manual_kb_tag-options-indexes","manual_kb_tag-directory-browsing","manual_kb_tag-prevent-file-listing","manual_kb_tag-wordpress-security","manual_kb_tag-htaccess-file"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":2,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9467\/revisions"}],"predecessor-version":[{"id":9468,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9467\/revisions\/9468"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=9467"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9467"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=9467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}