Skip to main content
Login Join
Snippet · Bash / Shell

Search and Replace URLs

Shared by Nikul Valani · July 24, 2026

Back to Snippets

Replace an old URL with a new one across the database.

wp search-replace 'https://oldsite.com' 'https://newsite.com' --all-tables
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments