If you need to temporarily (or long-term, I suppose) redirect your entire WordPress site to another domain or URL, but you still want to access the backend WP Admin, then this takes care of everything. Unless you’re logged-in (or on the login page), this forces all frontend pages to redirect to a new URL.
Note #1: Of course you’ll need to edit the snip by changing it to the NEW_URL
you want.
Note #2: Sometimes, right after saving this, you might get redirected. If so, just go back to WordPress site admin URL (usually: site.com/wp-admin/). If you still cannot get there, try adding Snippet Safe Mode at the end of your URL, like this: ?snippets-safe-mode=true
Leave a Reply