Created
February 5, 2019 00:55
-
-
Save malkafly/1951e7136460da04fe2dcc72c922d0f8 to your computer and use it in GitHub Desktop.
update wordpress url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link = mysqli_connect("localhost", "user", "password", "database"); | |
if($link === false){ | |
die("ERROR: Could not connect. " . mysqli_connect_error()); | |
} | |
$sql = "UPDATE wp_options SET option_value = replace(option_value, 'http://oldserver.com.br', 'http://newserver.com.br') WHERE option_name = 'home' OR option_name = 'siteurl';"; | |
if(mysqli_query($link, $sql)){ | |
echo "feito."; | |
} else { | |
echo "ERROR: $sql. " . mysqli_error($link); | |
} | |
mysqli_close($link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment