Remove Default WP Themes From Core


#1

Anyone know how to eliminate the automatic download of the default WP themes (Twenty Fifteen, etc)?

Would like to remove them from the admin to clean things up.


#2

Use Bedrock :smile:

You can remove this plugin or just have WP_DEFAULT_THEME defined


#3

I’m a little slow. I’m using Bedrock and already see this snippet, but I have all the default WP themes in my project.


#4

Right, that is pointing WP to the themes in the web/wp/wp-content/themes directory. Removing it will only show themes in web/app/themes.


#5

Ok, I’ll just deregister. Thank you.


#6

By deregister, do you mean delete the file web/app/mu-plugins/register-theme-directory.php in your project? Because that’s all you need to do…


#7

yea I just commented it out.


#8

For those like me using Trellis, here is how it seems to me is the best-est way to do it.

Since it’s a configuration you’ll probably want on all your environments, thus edit ./site/config/application.php

Around line 39 you should see:

define('CONTENT_DIR', '/app');
define('WP_CONTENT_DIR', $webroot_dir . CONTENT_DIR);
define('WP_CONTENT_URL', WP_HOME . CONTENT_DIR);

Add a line right underneath:

define('WP_DEFAULT_THEME', CONTENT_DIR . '/themes');

Done.


#9

I had thought WP_DEFAULT_THEME is for defining the default theme - but it seems to be setting the theme directory instead? Is there any documentation for this?