WP-CLI works on non WP-CLI installed WordPress instance?

Yes, of course it does, as long as you also have SSH access to the instance (it won’t work over FTP). There’s nothing special about WordPress instances installed via WP-CLI. Commands such as wp core download and wp core install perform the same actions you would normally do when installing manually.

wp-cli import theme sample data

I just filed to a PR to the WPTest.io “theme test data”. In short it’s the following series of commands. You just have to replace The remote request provider. In the example it’s curl, but you could use wget or others as well The remote request target. In the example it’s the wptest.io XML/WRX file. … Read more

WP-CLI :: Cannot installing plugin as www-data

Based on the issue you’ve reported and preview of the shell bash, it looks as if you may have the wrong owner/group and permissions set for the website’s docroot. More than likely in your hosting environment, the entire ks320 directory currently does not have www-data as the group assignment. It can be owned by root … Read more

wp-cli doesn’t find and wordpress installation

If no –path is passed, WP-CLI defaults to the current directory and looks for the wp-includes/version.php file. So, make sure that the directory you’re in has such a file: $ ls wp-includes $ cat wp-includes/version.php $ wp core version

How to create a WP-CLI command with $_POST?

The main problem is that your wp_reset_init() method deals with too many things. It’s looking at the $_POST request, it’s performing database queries, and it’s performing redirects. You need to separate your concerns so you end up with a new method which only performs the database reset, and which accepts parameters rather than using $_POST … Read more

WP-CLI get all posts from certain post type and taxonomy term

Assume we have a custom post type movie (slug) and a custom taxonomy cast (slug). 1) To find all movies starring Emily Watson, stored with the term slug emily-watson, we can do: wp post list –post_type=movie –cast=emily-watson to list all her movies. 2) To find all movies featuring Elizabeth Taylor or Richard Burton , stored … Read more