Batch Replace URLs in WordPress Database

No because you’re running the command on the posts table, and only on the content column, but ACF fields aka post meta are stored in the post meta table, not the content column of the posts table so no search replacing is occurring. You can tell WP CLI to perform the search replace with PHP … Read more

Disappearing plugins

Figured it out… I had Admin Menu Editor Pro installed, and I forgot it has the ability to hide plugins, which I had apparently done at some point and forgot about. D’Oh!

wp cli media commands not working

Media is the post type (post_type=”attachment”), so most operations are done with wp post command. By default, wp post manage blog posts (post_type=”post”), therefore by fetching post IDs you must add –post_type=attachment indicating the type of posts. And to update media meta you should use wp post meta update <id> <key> <value> Your entire command … Read more

Weird WP -Cli Error Connection Refused

For anyone else who comes across this post… the above issue was caused by the w3-total-cache plugin being migrated between Test and Staging servers. To fix the issue, I deactivate and exclude w3-total-cache tables from the Test server’s db export, then I do the upload and import to Staging server, which has its own “local” … Read more

Can WP-CLI modify database connection details in existing wp-config file?

You can use wp config set to update any existing value in wp-config or to add a new value: wp config set DB_NAME some_db_name wp config set DB_USER some_db_username wp config set DB_PASSWORD you_secret_value_pass See https://developer.wordpress.org/cli/commands/config/set/ Keep in mind that values are case sensitive, so if you do wp config set db_name some-db, it will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)