Can wordpress theme folder name be changed freely and nothing technically happens

This depends on how the theme was developed from the beginning. Theoretically, if everything was coded to standards you can rename the folder and nothing bad will happen.

When renaming the folder you are at risk of breaking code that asks specifically for files from the theme directory by name. WordPress offers a number of functions to help decouple the theme directory.

Using these function a theme can achieve loose coupling with what directory it resides in. Thus, if the theme that you want to rename the directory for has made good use of the above functions, then you should be fine.

Just in case, you can do a grep for the theme directory and see if it pops up in any javascript as a hardcoded path.

You will however have to reactivate it in your Appearance > Themes.

I just did this with twentyten and when you go to the admin you will see:

The active theme is broken. Reverting to the default theme.

Reactivate the theme and see if it works. twentyten does, twentyeleven does too.

The same goes for plugins, too.

wp_enqueue_style and wp_enqueue_script Codex pages state the following:

You should never hardcode URLs to local scripts, use Function Reference/plugins_url (for Plugins) and Function Reference/get_template_directory_uri (for Themes) to get a proper URL.

Leave a Comment