Search code examples
phpwordpresswp-cli

Download WordPress core files via WP-CLI without default themes and plugins?


When using WP-CLI on Windows, everything works fine. However, I've encountered an issue when I'm in the project root folder and want to download the WordPress core files while skipping all the default WordPress themes (twenty*).

I've been using the command wp core download --skip-themes --debug for this purpose, but it always downloads all the default themes. I'm looking for a way to get WP-CLI to only provide me with the core files, excluding the default WordPress themes.

I'm wondering if there's a command for deleting folders. If this task can't be accomplished with WP-CLI, I'm open to other methods that could automatically remove the default themes from the WordPress core download without me having to manually go into the project folder.


Solution

  • You can use --skip-content.

    From https://developer.wordpress.org/cli/commands/core/download/

    Download WP without the default themes and plugins

    The --skip-themes flag is not meant for this, but to disable loading installed themes during wp-cli execution (in case there is some theme triggered logic you may want to avoid executing).

    There is no wp-cli command to delete files, that doesn't make a lot of sense. You can always delete them with the appropriate commands for your platform.