wp-cli with MAMP shows sh: mysql: command not found

It looks like you probably don’t have mysql in your path. From the command prompt, you should be able to run ‘mysql’ and enter the mysql interactive environment. If you see something like ‘command not found.’ then keep working on that path. There are few different ways to set up your path, I prefer to … Read more

Import Media To CPT with CLI & Filter Custom Taxonomy

In WP-CLI list the arguments in WP_Query are defined by the associated arguments like –post_type=post. To be able to filter custom taxonomies you would need to use tax_query. Unfortunately WP-ClI does not support argument array so it is not possible. It is on the other hand possible with the WP-CLI Rest package. You can install … Read more

wp core install database connection error

First ensure the normal browser install works. If not, here’s a really good article on that: How to Fix the Error Establishing a Database Connection in WordPress. Next thing to note is that your database may not be hosted on localhost. Then try to create the wp-config.php using 127.0.0.1 or 127.0.0.1:8889 (for MAMP for example) … Read more

Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]

You should try running WP-CLI’s search-replace command. $ wp search-replace ‘http://example.com’ ‘https://example.com’ –all-tables But you said these URLs are placed from a shortcode? Then you need to find out what this shortcode actually is doing. As it not necessarily has saved the URLs to the database. Maybe it’s a setting in the shortcode and then … Read more

wp-cli create post and media import

There is just to display images BUT you can specify in which size the image(s) will be displayed. By default it’s size=”thumbnail”. Simply set it to size=”full” to just get one full-sized image: $ wp post create –post_title=”Foobar” –post_content=”” More gallery shortcode options can be found on wordpress.com: https://en.support.wordpress.com/gallery/#gallery-shortcode

WP-CLI over SSH – wp command not found

Found a solution here https://github.com/hrsetyono/wordpress/wiki/WP-CLI-on-Webfaction . This seems to be Webfaction specific issue You simply need to open FTP and append this line in /home/yourname/.bashrc export PATH=$PATH:$HOME/bin

Listing posts with wp-cli

the first request doesn’t show any custom post type (polylang_mo is a custom post type) polylang_mo is a private custom post type so unless I explicitly request this post type, it won’t be included. the second request shows only 1 page (instead of 3) Polylang was actually filtering the results. Adding –skip-plugins=polylang makes the 3 … Read more

Change old URLs after the domain change

Two possible easy ways to replace Old website URL to New Website URL: 1/ Directly replace in SQL file: Export the database and open SQL file. Manually find and replace old website URL with new website URL. Once replace is done, save and import database again. 2/ Use Migrate DB plugin: Use the third-party WordPress … Read more