What user should I use for wp-cli on Ubuntu VPS [closed]

I think the error is very clear. The owner of public_html is www-data, you don’t have any permisson to write to that folder. You can use whatever user you want as long as that user have permission to read, write and execute your DOCUMENT_ROOT folder. But you shouldn’t use root user. So, to solve that … Read more

Removing all post tags except a given list

Assuming you have a CSV file of your excluded ids and that this file name is exclude_tags.csv the format of that file should be 1,2,3,4 This would represent tags with id 1,2,3 and 4 try this $ wp term list post_tag –exclude=$(cat exclude_tags.csv) –field=term_id | xargs wp term delete post_tag Basically, this will send the … Read more

Add passwords to config.yml to manage multiple sites

If you are using SSH to connect to your sites then you can set up SSH aliases in your SSH config file. There are many advantages to doing this, one of them being that you use your SSH key to login to sites rather than having to type passwords. I do this with WP-CLI and … Read more

One-click WP site generation wih wp-cli on Windows

This is the script I use on Windows under XAMPP. It includes a MySQL command to create the database, and a tweak to improve security by nuking user 1 (and all its content) straight after install, resulting in a clean empty database. @echo off set dbName=”wp_yourdbname” set dbPass=”your_random_db_password” set siteUrl=”sitename.localdev.yourdomain.com” set siteName=”Kluwell” set siteDesc=”” set … Read more

WPCLI doesn’t recognize the site

There is only one function in wp-cli which will return this error and it is wp_not_installed wp_not_installed definition. as you see function is checking if your site is installed by calling function from WordPress core is_blog_installed. is_blog_installed definition. It is hard to tell what is happening exactly with your site but I would try to … Read more

Using wp-cli and delete everypost first image

According to the WP-CLI docs for the wp search-replace command (and wp db search, for that matter), you have to pass your search string without delimiters and pass any flags separately. Instead of: wp search-replace ‘/<img[^>]+\>/i’ ” wp_posts –regex –allow-root You would use something more like this: wp search-replace ‘<img[^>]+\>’ ” wp_posts –regex –allow-root –regex-flags=”i” … Read more

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