How To Stop Directory Browsing On WordPress


While working with WordPress, we will get some issues also. One of the major and dangerous issues is directory browsing.  In this post, we will show you that how can you stop directory browsing on WordPress blog.

Stop Directory Browsing On WordPress

If you didn’t do it, your WordPress blog is at risk. Hackers can find weak points and they can access your blog.

onesignal directory listing

How To Stop Directory Browsing On WordPress

You don’t need to use third-party plugins for this. You can simply disable directory browsing using a code. So, let’s start.

You need to edit your blog’s htaccess file. You can do it by accessing the file from file manager or by using Yoast SEO plugin. In my case, I am going to choose Yoast SEO plugin.

Go to tools section under Yoast settings and choose file editor.

yoast editor

Now, you need to choose the htaccess file from there.

htaccess file editor

Simply add the below code to the htaccess file.

Options -Indexes

Save it.

save htaccess

That’s all. You are not successfully disabled the directory browsing on your blog. From now on, while a user checks inside your plugins or themes folder, they will see a 404 error page.

This is how you can disable directory browsing on WordPress. We hope you enjoyed the read and found it useful. If you did, please consider sharing our article with your friends. It will help them to secure their blog and us to write more related posts. Check our post about protecting WordPress login page if you need to improve your blog’s security.


Leave a Reply