Roots Discourse

Remove Default WP Themes From Core

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.


Use Bedrock :smile:

You can remove this plugin or just have WP_DEFAULT_THEME defined


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.

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.

1 Like

Ok, I’ll just deregister. Thank you.

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…


yea I just commented it out.

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);

Add a line right underneath:

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



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?

It’s setting the theme directory, not a specific theme. I haven’t noticed that constant mentioned in the docs but a quick check of the code shows this to be the case.

1 Like

Thanks for this. Looking closer though, it looks like this constant is ultimately used for setting the default theme; check it out:

The code from Bedrock that you referenced seems to be setting up a directory to contain themes, but only if the default theme constant isn’t set.

this has to be define('WP_DEFAULT_THEME', 'CONTENT_DIR' . '/themes'); (note the single quotes around CONTENT_DIR) - otherwise it will throw a php-error …

These solutions merely hide those themes, but they do not stop them from downloading as the original poster requested.

There is a PR on github to address this

The solution there is similar to this one, but more targeted:

There are a couple of related issues on Github

1 Like

PS, if you want to also remove them from sites that already have them downloaded, then you would need to use not the post-root-install-package callback, but also the post-update-cmd. So in that case, rather than the code in the Github PR, the Scripts section of your composer.json would look something like this

  "scripts": {
"post-root-package-install": [
  "php -r \"copy('.env.example', '.env');\"",
    "composer run remove-old-wp-themes"
"post-update-cmd": [
    "composer run remove-old-wp-themes"
"remove-old-wp-themes": [
  "rm -rf web/wp/wp-content/themes/twentyten",
  "rm -rf web/wp/wp-content/themes/twentyeleven",
  "rm -rf web/wp/wp-content/themes/twentytwelve",
  "rm -rf web/wp/wp-content/themes/twentythirteen",
  "rm -rf web/wp/wp-content/themes/twentyfourteen",
  "rm -rf web/wp/wp-content/themes/twentyfifteen",
  "rm -rf web/wp/wp-content/themes/twentysixteen",
  "rm -rf web/wp/wp-content/themes/twentyseventeen",
  "rm -rf web/wp/wp-content/themes/twentynineteen",
  "rm -rf web/wp/wp-content/themes/twentytwenty"
"test": [