home.social

#wp-cli — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #wp-cli, aggregated by home.social.

fetched live
  1. Building Custom WP-CLI Commands for Massive Data Migrations
    ----------
    Does this sound familiar? You need to update a custom field for 50,000 products or[…]
     
    #WordPress #Dev #migration #WPCLI

    wpnews.io/building-custom-wp-c

  2. Between WP-CLI, Acorn, and WordPress, you can build custom commands that assist with site maintenance. This post shows you how.
     
    #WordPress #Dev #Acorn #Composer #WPCLI
    ift.tt/Az5MiHw

  3. Using WP-CLI to Delete Posts Containing a Specific Metadata Value

    I was doing some maintenance on a WordPress site for a client, and for very specific reasons, I had to use non-interactive WP-CLI commands to do anything on this site.

    What I wanted to do

    Delete all pages that contained a custom postmeta key and value.

    For the sake of this example, I wanted to delete:

    • Post Type: Only “page” types
    • Containing the “_mykey” custom meta key with the value “value1”

    Solution

    Verify the posts that are going to be deleted first

    It’s always advisable to double check what you’re going to delete first. The “measure twice, cut once” one database management.

    wp post list --meta_key="_mykey" --fields="ID" --format=ids --post_type=page --meta_value="value1"


    Delete the Data

    Now that you’ve confirmed what you’re going to delete is correct, you can proceed.

    wp post delete $(wp post list --meta_key="_mykey" --fields="ID" --format=ids --post_type=page --meta_value="value1")

    For an added measure of safety, this only moves the posts into the trash. If you wanted to permanently delete them, add the --force flag to the delete command,

    wp post delete $(wp post list --meta_key="_mykey" --fields="ID" --format=ids --post_type=page --meta_value="value1") --force

    Bonus

    If you want to delete the posts that contain the “_mykey” meta_key, regardless of what the value is in meta_value,

    wp post delete $(wp post list --meta_key="_mykey" --fields="ID" --format=ids --post_type=page) --force

    #WPCLI
  4. Script to install #WordPress using #WPCLI: This tool helps you generate the commands to install WordPress with a specific theme and plugins. To use, build your config, then just paste into the terminal of your web hosting account. Securely just within your web browser 👍

    encode.host/knowledgebase/4716/

  5. Do I know anyone here who could help me with writing A basic #PHPUnit test for a #wpcli plugin I'm writing? Everything online I'm finding is how to scaffold unit tests with wpcli for a WordPress plugin, but not how to write tests for the actual wpcli part.

    #testing #PHP #WordPress

  6. Another nice thing about Local: wp-cli is built in.

  7. ⚙️ SSD-Powered #cPanel Web #Hosting – Up to 25x Faster ⚙️ SSD-Powered cPanel Web Hosting by Rad Web Hosting
    Built for Performance. Backed by Reliability. Ready to Scale.
    Developers, sysadmins, and power users—we built this for you. Our SSD-powered cPanel hosting is engineered on high-availability ...
    Continued 👉 blog.radwebhosting.com/ssd-pow #joomla #postgresql #letsencrypt #webhosting #cloudlinux #phpmyadmin #phppgadmin #wpcli #csf #softaculous #laravel #mariadb #litespeed

  8. ⚙️ SSD-Powered #cPanel Web #Hosting – Up to 25x Faster ⚙️ SSD-Powered cPanel Web Hosting by Rad Web Hosting
    Built for Performance. Backed by Reliability. Ready to Scale.
    Developers, sysadmins, and power users—we built this for you. Our SSD-powered cPanel hosting is engineered on high-availability ...
    Continued 👉 blog.radwebhosting.com/ssd-pow #letsencrypt #phpmyadmin #mariadb #litespeed #cloudlinux #postgresql #phppgadmin #wpcli #laravel #csf #softaculous #joomla #webhosting

  9. ⚙️ SSD-Powered #cPanel Web #Hosting – Up to 25x Faster ⚙️ SSD-Powered cPanel Web Hosting by Rad Web Hosting
    Built for Performance. Backed by Reliability. Ready to Scale.
    Developers, sysadmins, and power users—we built this for you. Our SSD-powered cPanel hosting is engineered on high-availability ...
    Continued 👉 blog.radwebhosting.com/ssd-pow #joomla #phpmyadmin #letsencrypt #phppgadmin #webhosting #wpcli #postgresql #cloudlinux #csf #mariadb #litespeed #laravel #softaculous

  10. WP-CLI is a command-line interface for WordPress that allows you to manage your WordPress installations without using a web browser. While many users are familiar with basic commands, its true power lies in its ability to automate complex tasks, perform advanced debugging, and interact with WordPress in ways not easily achieved through the admin panel.

    Here are some "out-of-the-ordinary" examples:

    encode.host/knowledgebase/4731/
    #WordPress #WPCLI

  11. 4 Ways To Generate Test Data in WordPress

    Manually adding this data to the database takes a lot of time. Learn how to generate WordPress data automatically.

    alexstandiford.com/articles/es