WordPress CLI not finding core files

153 Views Asked by At

trying to use the WP CLI for search-replace but it is not working, I get this message below.

Error: This does not seem to be a WordPress installation.
Pass --path=`path/to/wordpress` or run `wp core download`

I am running this command at the root of the WP site

thoughts?

2

There are 2 best solutions below

2
Caleb On

Latest version of WP CLI specifically looks for wp-includes/version.php in the ABSPATH directory: check that ABSPATH constant is properly defined, and that wp-includes/version.php file exists inside of directory defined in ABSPATH constant.

Source: https://github.com/wp-cli/wp-cli/blob/main/php/WP_CLI/Runner.php#L960

0
Richard On

You have to be in your wordpress directory where your core files are to run that command