Send by LINE
B! Bookmarks in Hate-bu
Bookmarks in Pocket
RSS feeds

WordPress, When the wp command is not available

wordpress image

The 'wp' command in WordPress allows you to do things like you would do in the admin panel by entering commands.

However, there were times when the 'wp' command did not work, which happened to me four times. I was just using it wrong.

If you use it in the same way as a shell command, you will get an error immediately.

This is written by a Japanese who can't speak English with the help of translation application. Sorry if it's not good.

The 'wp' command is the 'wp-cli' module, which controls WordPress from the command line.

What you can do in the WordPress admin panel, you can also do with the 'wp' command. In addition, you can also do things that directly affect the system, such as building test environments and manipulating databases.

This is an advanced WordPress management tool.

However, it is not a standard tool of WordPress. The development project is also independent of WordPress.

When you install WordPress, there is no 'wp-cli' module. You will need to install it yourself.

So much for the explanation, the 'wp' command often causes errors like this.

Error in wp command
wp core check-update
Error: This does not seem to be a WordPress install. Pass --path=`path/to/wordpress` or run `wp core download`.
WordPress is not installed?
What? Why? I have WordPress?

This is an error that I think about over and over again.

This error is caused by the 'wp' command not being able to recognize the WordPress installation path.

You don't need to download wp-core, it is a core module of WordPress, so it is included in WordPress.

There are two solutions: either

  • Execute the command in the WordPress installation directory.
  • Specify the option '--path="/xxx/xxx/DocumentRoot"' with the 'wp' command
Move the directory and execute the command.
cd /home/myuser/sample/DocumentRoot
wp core check-update

You can run it in any level of your WordPress installation. It can be the plugin directory, or the theme file directory.

Execute the command with the '--path' option
wp core check-update --path="/home/myuser/sample/DocumentRoot"
Leave a Reply