5 examples for wp

{{ score }}
  # Adds a new user with user name "janesmith" to the Wordpress database as an
# admin.
wp user create janesmith jsmith@gmail.com --role=administrator --user_pass=farglenuts --display_name="Jane Smith"
        
{{ score }}
  # The following bash script will searches through all rows in a selection of tables and replaces appearances of the first string with the second string.

#!/bin/bash
if $(wp --url=http://example.com core is-installed --network); then
    wp search-replace --url=http://example.com 'http://example.com' 'http://example.dev' --recurse-objects --network --skip-columns=guid
else
    wp search-replace 'http://example.com' 'http://example.dev' --recurse-objects --skip-columns=guid
fi
        
{{ score }}
  # Install a Turdpress plugin and activate it
wp plugin install plugin-name --activate
        
{{ score }}
  # Flush permalinks!
wp rewrite flush
        
{{ score }}
  # Export posts published by the user between given start and end date
$ wp export --dir=/tmp/ --user=admin --post_type=post --start_date=2011-01-01 --end_date=2011-12-31
Starting export process...
Writing to file /tmp/staging.wordpress.2016-05-24.000.xml
Success: All done with export.

# Export posts by IDs
$ wp export --dir=/tmp/ --post__in=123,124,125
Starting export process...
Writing to file /tmp/staging.wordpress.2016-05-24.000.xml
Success: All done with export.

# Export a random subset of content
$ wp export --post__in="$(wp post list --post_type=post --orderby=rand --posts_per_page=8 --format=ids)"
Starting export process...
Writing to file /var/www/example.com/public_html/staging.wordpress.2016-05-24.000.xml
Success: All done with export.