How to rename wp-includes folder?

The question:

Is there a way that we could rename wp-includes folder

I have found out there are ways to do for other folders. But how do we do it for wp-includes folder?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

Unfortunately not at the moment. If you look in wp-includes/default_constants.php, the WP_CONTENT_DIR and other constants all have a if ( ! defined(constant) ) check before them.

WPINC (the wp-includes constant) does not. It’s defined in wp-settings.php, and has no if ( ! defined(WPINC) ) check, so defining it before hand (in your wp-config.php) would just result in an error.

Also, altering core you could do this, but as soon as you update WordPress, Core files would be reverted, and therefore it would revert back to wp-includes.

I suggestion just masking your site with WordPress in a subdirectory (call it xadw or something nobody would guess) and just set the home URL to be the actual domain. Then put your wp-content folder in another folder, so it won’t be obviously when people look at uploads, etc.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment