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

WP-CLI update date and time format

The wp-cli command structure would be: wp option update timezone_string “American/New_York” So: option to act on a WordPress option update to update the option the option name, in this case ‘timezone_string’ the new value, in this case ‘American/New_York’ Items 3 and 4 are defined by WordPress, a plugin, or other custom code. Number 4, the … Read more

Using wp-cli to Update WP Networks / Multisite from 3.5.1 to 3.8

For regular users, the preferred update method is pressing the “Update” button in wp-admin. For sysadmins, wp core update + wp core update-db will probably be a lot faster. Note that for multisite instances, you’ll have to update the DB for each site in the network. See https://github.com/wp-cli/wp-cli/issues/683 NB: I might be biased, since I’m … Read more

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