WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I want to rename the theme's root folder for security purpose.

I put these in wp-config.php file:

But I want to rename the theme's root directory also:

 define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/assets' );
 define( 'WP_CONTENT_URL', 'http://www.domain.in/assets');

 define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/extension' );
 define( 'WP_PLUGIN_URL', 'http://www.domain.in/assets/extension');

So, how to rename the theme's root folder like this way?

share|improve this question

marked as duplicate by toscho Jun 25 '13 at 6:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Unfortunately you can't, themes is hardcoded throughout WordPress. May I ask how you think this will improve security? – TheDeadMedic Jun 24 '13 at 10:07
up vote 1 down vote accepted

Although @TheDeadMedic is technically correct and you can't rename the themes folder. You CAN change some of the public facing urls.

For example, you can make a new folder assets/new-themes and add your CSS, and images there. Then make a theme include your styles.css (which can be just the header info) and anytime in your theme you want to refer to any image, css, or JS (public urls) set that to your new theme folder (or CDN if your fancy)

I'm not sure how changing the name of the directory would improve security as there are so many ways to find out if someone is using WP but that's just one way to apply a similar effect.

UPDATE: Looks like you can use the hook register_theme_directory() to add an additional theme dir. (see link to duplicate question above)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.