• Hi,

    I’ve been reading a few articles about securing WordPress from getting hacked.

    I’ve already implemented some security measures but I’d like to add the following 2 security measures also. Could someone tell me if these 2 will work fine?

    1. Add the following to your .htaccess file:
    `# prevent directory browsing
    Options -Indexes

    Order Allow,Deny
    Deny from all`

    2. Add index.php to ALL folders

    By default, wp-admin, wp-content and plugins folders have an index.php file. However, wp-includes, uploads and upgrade folders don’t have index.php. And my 2012 child theme doesn’t contain an index.php file either. Is it ok if I add an index.php file to all of these directories including the 2012 child theme and other themes?

    Awaiting a reply,
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey,

    You may run into issues with adding it to your child theme since the index.php file is the default template for any view that doesn’t have a defined layout within your theme.
    A helpful graphic can be found here

    Thread Starter befree22

    (@befree22)

    Hi,

    OK, forget adding the index.php file to the WP child theme folder.

    What about adding it to wp-includes, uploads and upgrade folders that don’t have index.php?

    Also, what about adding the .htaccess file?

    Thanks

    Hey,

    You shouldn’t have any issues adding it to the other folders. I don’t play with the .htaccess file too much but there are some good tips in this article from the codex regarding the .htaccess file.

    Thread Starter befree22

    (@befree22)

    Hi,

    I do appreciate your help. I looked at the WP hierarchy image you sent me and I want to avoid causing problems with WP updates and site functioning.

    I will go ahead and add index.php to wp-includes, uploads and upgrade folders and I’ll test the site just to be sure everything is runs fine.

    Thanks a lot
    Happy Holidays!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help adding index.php to ALL directories for security’ is closed to new replies.