Home » Wordpress » WordPress Renaming Themes Folder

WordPress Renaming Themes Folder

Posted by: admin November 30, 2017 Leave a comment

Questions:

I’m wondering how I would rename the ‘themes’ folder in the wp-content. I’ve renamed my wp-content folder and the actual active theme folder name, but I’m after renaming the folder the themes are stored in.

/wp-content/themes/themename

the middle one lol.

Does anyone know how this would be achieved?

Answers:

The following will enable the directory “t”, in the root of the site, to be used as an extra Themes directory

register_theme_directory( '/www/htdocs/username/public_html/t' );

I think you’d like this thread: Steps to Take to Hide the Fact a Site is Using WordPress?

Questions:
Answers:

This is usefull if you want to keep plugins and uploads in ex. separate server for CDN purpose (NFS) and remove public/www permission. In this case you only deploying themes instead of plugins, uploads etc.

define('WP_CONTENT_DIR', __DIR__ . '/data/wp-content');
define('WP_CONTENT_URL', 'http://{your-url/to-blog}/wp-content');
define('WP_PLUGIN_DIR', __DIR__ . '/data/wp-content/plugins');
define('WP_PLUGIN_URL', 'http://{your-url/to-blog}/wp-content/plugins');

$wp_theme_directories = array(__DIR__ . '{/directory-to-themes}');
define('WP_DEFAULT_THEME', '{your-default-theme}');

Remember:
1. Order of lines in wp-config is important
2. Keep themes folder in wp-content (even if it will be empty)