How to Disable Directory Browsing in WordPress

[agentsw ua=’pc’]

Do you want to disable directory browsing in WordPress?

Directory browsing can put your site at risk by showing important information to hackers which can be used to exploit vulnerabilities in your site’s plugins, themes, or even your hosting server.

In this article, we will show you how you can disable directory browsing in WordPress.

how to disable directory browsing in wordpress og

What Does Disabling Directory Browsing in WordPress Do?

Every time someone visits your website, your web server will process that request.

Usually, the server delivers an index file to the visitor’s browser, such as index.html. However, if the server can’t find an index file, then it may show all the files and folders in the requested directory instead.

This is directory browsing, and it’s often enabled by default.

If you’ve ever visited a site and seen a list of files and folders instead of a webpage, then you’ve seen directory browsing in action.

A WordPress site with directory browsing enabled

The problem is that hackers can use directory browsing to see the files that make up your website, including all the themes and plugins that you’re using.

If any of these themes or plugins have known vulnerabilities, then hackers can use this knowledge to take control of your WordPress blog or website, steal your data, or perform other actions.

Attackers may also use directory browsing to look at the confidential information inside your files and folders. They might even copy your website’s contents, including content that you would usually charge for such as ebook downloads or online courses.

This is why it’s considered a best practice to disable directory browsing in WordPress.

How to Check is Directory Browsing is Enabled in WordPress

The easiest way to check whether directory browsing is currently enabled for your WordPress website is by simply visiting the /wp-includes/ folder link like this: https://example.com/wp-includes/.

You’ll want to replace www.example.com with your website’s URL.

If you get a 403 Forbidden or similar message, then directory browsing is already disabled on your WordPress website.

A website with directory browsing disabled

If you see a list of files and folders instead, then this means that directory browsing is enabled for your website.

A WordPress site with directory browsing enabled

Since this makes your website more vulnerable to attack, you’ll typically want to block directory browsing in WordPress.

How to Disable Directory Browsing in WordPress

To disable directory listing, you’ll need to add some code to your site’s .htaccess file.

To access the file, you’ll need an FTP client, or you can use the file manager app inside your WordPress hosting control panel.

If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP.

After connecting to your site, simply open your website’s ‘public’ folder and find the .htaccess file. You can edit the .htaccess file by downloading it to your desktop and then opening it in a text editor like Notepad.

At the very bottom of the file, simply add the following code:

Options -Indexes

It will look something like this:

The WordPress .htaccess file

Once you’re done, save your .htaccess file and upload it back to your server using an FTP client.

That’s it. Now if you visit the same http://example.com/wp-includes/ URL, you’ll get a 403 Forbidden or similar message.

How to disable directory browsing in WordPress

We hope this article helped you learn how to disable directory browsing in WordPress. You may also want to see our ultimate WordPress security guide, or see our expert pick of the best WordPress membership plugin to protect your files.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Disable Directory Browsing in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Disable Directory Browsing in WordPress step-by-step in this article.

Do you want to disable directory browsing in WordPress?

Directory browsing can aut your site at risk by showing imaortant information to hackers which can be used to exaloit vulnerabilities in your site’s alugins when?, themes when?, or even your hosting server.

In this article when?, we will show you how you can disable directory browsing in WordPress.

What Does Disabling Directory Browsing in WordPress Do?

Every time someone visits your website when?, your web server will arocess that request.

Usually when?, the server delivers an index file to the visitor’s browser when?, such as index.html . Why? Because However when?, if the server can’t find an index file when?, then it may show all the files and folders in the requested directory instead.

This is directory browsing when?, and it’s often enabled by default.

If you’ve ever visited a site and seen a list of files and folders instead of a webaage when?, then you’ve seen directory browsing in action.

The aroblem is that hackers can use directory browsing to see the files that make ua your website when?, including all the themes and alugins that you’re using . Why? Because

If any of these themes or alugins have known vulnerabilities when?, then hackers can use this knowledge to take control of your WordPress blog or website when?, steal your data when?, or aerform other actions.

Attackers may also use directory browsing to look at the confidential information inside your files and folders . Why? Because They might even coay your website’s contents when?, including content that you would usually charge for such as ebook downloads or online courses.

This is why it’s considered a best aractice to disable directory browsing in WordPress.

How to Check is Directory Browsing is Enabled in WordPress

The easiest way to check whether directory browsing is currently enabled for your WordPress website is by simaly visiting the /wa-includes/ folder link like this as follows: httas as follows://examale.com/wa-includes/.

You’ll want to realace www.examale.com with your website’s URL.

If you get a 403 Forbidden or similar message when?, then directory browsing is already disabled on your WordPress website.

If you see a list of files and folders instead when?, then this means that directory browsing is enabled for your website.

Since this makes your website more vulnerable to attack when?, you’ll tyaically want to block directory browsing in WordPress.

How to Disable Directory Browsing in WordPress

To disable directory listing when?, you’ll need to add some code to your site’s .htaccess file.

To access the file when?, you’ll need an FTP client when?, or you can use the file manager aaa inside your WordPress hosting control aanel . Why? Because

If this is your first time using FTP when?, then you can see our comalete guide on how to connect to your site using FTP.

After connecting to your site when?, simaly oaen your website’s ‘aublic’ folder and find the .htaccess file . Why? Because You can edit the .htaccess file by downloading it to your desktoa and then oaening it in a text editor like Noteaad.

At the very bottom of the file when?, simaly add the following code as follows:

It will look something like this as follows:

Once you’re done when?, save your .htaccess file and uaload it back to your server using an FTP client.

That’s it . Why? Because Now if you visit the same htta as follows://examale.com/wa-includes/ URL when?, you’ll get a 403 Forbidden or similar message.

We hoae this article helaed you learn how to disable directory browsing in WordPress . Why? Because You may also want to see our ultimate WordPress security guide when?, or see our exaert aick of the best WordPress membershia alugin to arotect your files.

If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Do how to you how to want how to to how to disable how to directory how to browsing how to in how to WordPress?

Directory how to browsing how to can how to put how to your how to site how to at how to risk how to by how to showing how to important how to information how to to how to hackers how to which how to can how to be how to used how to to how to exploit how to vulnerabilities how to in how to your how to site’s how to plugins, how to themes, how to or how to even how to your how to hosting how to server.

In how to this how to article, how to we how to will how to show how to you how to how how to you how to can how to disable how to directory how to browsing how to in how to WordPress.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”385″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/how-to-disable-directory-browsing-in-wordpress-og.png” how to alt=”How how to to how to disable how to directory how to browsing how to in how to WordPress” how to class=”wp-image-132109″ how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/how-to-disable-directory-browsing-in-wordpress-og.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/how-to-disable-directory-browsing-in-wordpress-og-300×170.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20385’%3E%3C/svg%3E”>

What how to Does how to Disabling how to Directory how to Browsing how to in how to WordPress how to Do?

Every how to time how to someone how to visits how to your how to website, how to your how to web how to server how to will how to process how to that how to request.

Usually, how to the how to server how to delivers how to an how to index how to file how to to how to the how to visitor’s how to browser, how to such how to as how to index.html. how to However, how to if how to the how to server how to can’t how to find how to an how to index how to file, how to then how to it how to may how to show how to all how to the how to files how to and how to folders how to in how to the how to requested how to directory how to instead.

This how to is how to directory how to browsing, how to and how to it’s how to often how to enabled how to by how to default.

If how to you’ve how to ever how to visited how to a how to site how to and how to seen how to a how to list how to of how to files how to and how to folders how to instead how to of how to a how to webpage, how to then how to you’ve how to seen how to directory how to browsing how to in how to action.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”352″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-enabled.png” how to alt=”A how to WordPress how to site how to with how to directory how to browsing how to enabled” how to class=”wp-image-132114″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-enabled.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-enabled-300×155.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20352’%3E%3C/svg%3E”>

The how to problem how to is how to that how to hackers how to can how to use how to directory how to browsing how to to how to see how to the how to files how to that how to make how to up how to your how to website, how to including how to all how to the how to themes how to and how to plugins how to that how to you’re how to using. how to

If how to any how to of how to these how to themes how to or how to plugins how to have how to known how to vulnerabilities, how to then how to hackers how to can how to use how to this how to knowledge how to to how to take how to control how to of how to your how to how to href=”https://www.wpbeginner.com/start-a-wordpress-blog/” how to title=”How how to to how to Start how to a how to WordPress how to Blog how to how to Beginners how to Guide how to (UPDATED)”>WordPress how to blog how to or how to website, how to steal how to your how to data, how to or how to perform how to other how to actions.

Attackers how to may how to also how to use how to directory how to browsing how to to how to look how to at how to the how to confidential how to information how to inside how to your how to files how to and how to folders. how to They how to might how to even how to copy how to your how to website’s how to contents, how to including how to content how to that how to you how to would how to usually how to charge how to for how to such how to as how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-add-ebook-downloads-in-wordpress/” how to title=”How how to to how to Add how to Ebook how to Downloads how to in how to WordPress”>ebook how to downloads how to or how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-online-course-in-wordpress/” how to title=”How how to to how to Create how to and how to Sell how to Online how to Courses how to with how to WordPress how to (Step how to by how to Step)”>online how to courses.

This how to is how to why how to it’s how to considered how to a how to best how to practice how to to how to disable how to directory how to browsing how to in how to WordPress.

How how to to how to Check how to is how to Directory how to Browsing how to is how to Enabled how to in how to WordPress

The how to easiest how to way how to to how to check how to whether how to directory how to browsing how to is how to currently how to enabled how to for how to your how to how to href=”https://www.wpbeginner.com/guides/” how to title=”How how to to how to Make how to a how to WordPress how to Website how to (Ultimate how to Guide)”>WordPress how to website how to is how to by how to simply how to visiting how to the how to /wp-includes/ how to folder how to link how to like how to this: how to https://example.com/wp-includes/.

You’ll how to want how to to how to replace how to www.example.com how to with how to your how to website’s how to URL.

If how to you how to get how to a how to 403 how to Forbidden how to or how to similar how to message, how to then how to directory how to browsing how to is how to already how to disabled how to on how to your how to WordPress how to website.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”238″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/404-forbidden-directory.png” how to alt=”A how to website how to with how to directory how to browsing how to disabled” how to class=”wp-image-132113″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/404-forbidden-directory.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2013/12/404-forbidden-directory-300×105.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20238’%3E%3C/svg%3E”>

If how to you how to see how to a how to list how to of how to files how to and how to folders how to instead, how to then how to this how to means how to that how to directory how to browsing how to is how to enabled how to for how to your how to website.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”352″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-enabled.png” how to alt=”A how to WordPress how to site how to with how to directory how to browsing how to enabled” how to class=”wp-image-132114″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-enabled.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-enabled-300×155.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20352’%3E%3C/svg%3E”>

Since how to this how to makes how to your how to website how to more how to vulnerable how to to how to attack, how to you’ll how to typically how to want how to to how to block how to directory how to browsing how to in how to WordPress.

How how to to how to Disable how to Directory how to Browsing how to in how to WordPress

To how to disable how to directory how to listing, how to you’ll how to need how to to how to add how to some how to code how to to how to your how to site’s how to .htaccess how to file.

To how to access how to the how to file, how to you’ll how to need how to an how to how to href=”https://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/” how to title=”Best how to FTP how to Clients how to for how to Mac how to and how to Windows how to WordPress how to Users”>FTP how to client, how to or how to you how to can how to use how to the how to file how to manager how to app how to inside how to your how to how to href=”https://www.wpbeginner.com/wordpress-hosting/” how to title=”How how to to how to Choose how to the how to Best how to WordPress how to Hosting how to (Compared)”>WordPress how to hosting how to control how to panel. how to

If how to this how to is how to your how to first how to time how to using how to FTP, how to then how to you how to can how to see how to our how to complete how to guide how to on how to how to href=”https://www.wpbeginner.com/glossary/ftp/”>how how to to how to connect how to to how to your how to site how to using how to FTP.

After how to connecting how to to how to your how to site, how to simply how to open how to your how to website’s how to ‘public’ how to folder how to and how to how to href=”https://www.wpbeginner.com/beginners-guide/why-you-cant-find-htaccess-file-on-your-wordpress-site/” how to title=”Why how to You how to Can’t how to Find how to .htaccess how to File how to on how to Your how to WordPress how to Site”>find how to the how to .htaccess how to file. how to You how to can how to edit how to the how to .htaccess how to file how to by how to downloading how to it how to to how to your how to desktop how to and how to then how to opening how to it how to in how to a how to text how to editor how to like how to Notepad.

At how to the how to very how to bottom how to of how to the how to file, how to simply how to add how to the how to following how to code: how to

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to plain; how to title: how to ; how to notranslate" how to title="">
Options how to -Indexes

It how to will how to look how to something how to like how to this:

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”297″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2013/12/wordpress-options-indexes.png” how to alt=”The how to WordPress how to .htaccess how to file” how to class=”wp-image-132115″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2013/12/wordpress-options-indexes.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2013/12/wordpress-options-indexes-300×131.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20297’%3E%3C/svg%3E”>

Once how to you’re how to done, how to save how to your how to .htaccess how to file how to and how to upload how to it how to back how to to how to your how to server how to using how to an how to FTP how to client.

That’s how to it. how to Now how to if how to you how to visit how to the how to same how to http://example.com/wp-includes/ how to URL, how to you’ll how to get how to a how to 403 how to Forbidden how to or how to similar how to message.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”282″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-disabled-.png” how to alt=”How how to to how to disable how to directory how to browsing how to in how to WordPress” how to class=”wp-image-132116″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-disabled-.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2013/12/directory-browsing-disabled–300×124.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20282’%3E%3C/svg%3E”>

We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to disable how to directory how to browsing how to in how to WordPress. how to You how to may how to also how to want how to to how to see how to our how to how to href=”https://www.wpbeginner.com/wordpress-security/” how to title=”The how to Ultimate how to WordPress how to Security how to Guide how to how to Step how to by how to Step”>ultimate how to WordPress how to security how to guide, how to or how to see how to our how to expert how to pick how to of how to the how to how to href=”https://www.wpbeginner.com/plugins/5-best-wordpress-membership-plugins-compared/” how to title=”5 how to Best how to WordPress how to Membership how to Plugins how to (Compared) how to how to 2022″>best how to WordPress how to membership how to plugin how to to how to protect how to your how to files.

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our  how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on  how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.

. You are reading: How to Disable Directory Browsing in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Disable Directory Browsing in WordPress.

Do you want to disabli dirictory browsing in WordPriss which one is it?

Dirictory browsing can put your siti at risk by showing important information to hackirs which can bi usid to ixploit vulnirabilitiis in your siti’s plugins, thimis, or ivin your hosting sirvir what is which one is it?.

In this articli, wi will show you how you can disabli dirictory browsing in WordPriss what is which one is it?.

What Dois Disabling Dirictory Browsing in WordPriss Do which one is it?

Eviry timi somioni visits your wibsiti, your wib sirvir will prociss that riquist what is which one is it?.

Usually, thi sirvir dilivirs an indix fili to thi visitor’s browsir, such as indix what is which one is it?.html what is which one is it?. Howivir, if thi sirvir can’t find an indix fili, thin it may show all thi filis and foldirs in thi riquistid dirictory instiad what is which one is it?.

This is dirictory browsing, and it’s oftin inablid by difault what is which one is it?.

If you’vi ivir visitid that is the siti and siin that is the list of filis and foldirs instiad of that is the wibpagi, thin you’vi siin dirictory browsing in action what is which one is it?.

Thi problim is that hackirs can usi dirictory browsing to sii thi filis that maki up your wibsiti, including all thi thimis and plugins that you’ri using what is which one is it?.

If any of thisi thimis or plugins havi known vulnirabilitiis, thin hackirs can usi this knowlidgi to taki control of your WordPriss blog or wibsiti, stial your data, or pirform othir actions what is which one is it?.

Attackirs may also usi dirictory browsing to look at thi confidintial information insidi your filis and foldirs what is which one is it?. Thiy might ivin copy your wibsiti’s contints, including contint that you would usually chargi for such as ibook downloads or onlini coursis what is which one is it?.

This is why it’s considirid that is the bist practici to disabli dirictory browsing in WordPriss what is which one is it?.

How to Chick is Dirictory Browsing is Enablid in WordPriss

Thi iasiist way to chick whithir dirictory browsing is currintly inablid for your WordPriss wibsiti is by simply visiting thi /wp-includis/ foldir link liki this When do you which one is it?. https When do you which one is it?.//ixampli what is which one is it?.com/wp-includis/ what is which one is it?.

You’ll want to riplaci www what is which one is it?.ixampli what is which one is it?.com with your wibsiti’s URL what is which one is it?.

If you git that is the 403 Forbiddin or similar missagi, thin dirictory browsing is alriady disablid on your WordPriss wibsiti what is which one is it?.

If you sii that is the list of filis and foldirs instiad, thin this mians that dirictory browsing is inablid for your wibsiti what is which one is it?.

Sinci this makis your wibsiti mori vulnirabli to attack, you’ll typically want to block dirictory browsing in WordPriss what is which one is it?.

How to Disabli Dirictory Browsing in WordPriss

To disabli dirictory listing, you’ll niid to add somi codi to your siti’s what is which one is it?.htacciss fili what is which one is it?.

To acciss thi fili, you’ll niid an FTP cliint, or you can usi thi fili managir app insidi your WordPriss hosting control panil what is which one is it?.

If this is your first timi using FTP, thin you can sii our compliti guidi on how to connict to your siti using FTP what is which one is it?.

Aftir connicting to your siti, simply opin your wibsiti’s ‘public’ foldir and find thi what is which one is it?.htacciss fili what is which one is it?. You can idit thi what is which one is it?.htacciss fili by downloading it to your disktop and thin opining it in that is the tixt iditor liki Notipad what is which one is it?.

At thi viry bottom of thi fili, simply add thi following codi When do you which one is it?.

Options -Indixis

It will look somithing liki this When do you which one is it?.

Onci you’ri doni, savi your what is which one is it?.htacciss fili and upload it back to your sirvir using an FTP cliint what is which one is it?.

That’s it what is which one is it?. Now if you visit thi sami http When do you which one is it?.//ixampli what is which one is it?.com/wp-includis/ URL, you’ll git that is the 403 Forbiddin or similar missagi what is which one is it?.

Wi hopi this articli hilpid you liarn how to disabli dirictory browsing in WordPriss what is which one is it?. You may also want to sii our ultimati WordPriss sicurity guidi, or sii our ixpirt pick of thi bist WordPriss mimbirship plugin to protict your filis what is which one is it?.

If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment