How WP-CLI Made Renaming My Website and Images a Breeze


I recently faced a bit of a pickle when I changed my website name from notbignoob.games to notbignoob.com. Not only were my images refusing to show up, but WordPress seemed stuck in the past, clinging to the old domain like a stubborn toddler. I even had to resort to hard-coding the new URL in wp-config.php just to get things moving. Thankfully, WP-CLI came to the rescue, making the whole renaming process a breeze!

Ready to dive into the world of WP-CLI? Here’s a fun and straightforward guide to renaming your website without the headaches:

  1. Fetch the Magic Wand: First, grab the WP-CLI file with this command:
    curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
  2. Make it Executable: Give your new tool some powers:
    chmod +x wp-cli.phar
  3. Move it to the Right Spot: Get it where it needs to be:
    sudo mv wp-cli.phar /usr/local/bin/wp
  4. Check Your New Companion: Ensure everything’s set up correctly:
    wp --info
  5. Navigate to Your Site: Head to your WordPress installation directory:
    cd /path/to/your/wordpress/installation
  6. Execute the Magic Rename: Finally, let WP-CLI work its charm:
    sudo -u www-data wp search-replace 'https://notbignoob.games' 'https://notbignoob.com' --all-tables
    (Remember to swap www-data for your user if needed!)
generated on napkin.ai

And just like that, you’ve transformed your website’s identity with ease! WP-CLI isn’t just a tool; it’s your new best friend for managing WordPress. Happy renaming!


Leave a Reply

Your email address will not be published. Required fields are marked *

Verified by MonsterInsights