Jika ada pernah mengganti url default wordpress (pada halaman setting-general) sehingga kacaulah tampilan situs wordpress Anda dan Anda tidak bisa masuk ke halaman Admin karena databasenya juga ikut rusak. Berikut adalah cara restore atau reset kembali link url situs wordpress Anda sehingga tampilannya kembali normal seperti semula dan anda bisa masuk ke halaman Admin kembali.
<?php #### WORDPRESS RESET ########### ## ## ## Allan Collins ## ## http://allancollins.net ## ## ## ## 1-12-2009 ## ################################ // HOW TO USE: // Simply type in the url in the text box to reset the WordPress site url. // WARNING: // This file can be a HUGE security risk and has the potential to seriously // mess up your site's database. Please use with caution and DELETE THIS FILE when you // are done resetting your website. // First, get database settings from wp-config.php... require_once("wp-config.php"); // Create a new database object... $db=new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME); // Was the form submitted? if (isset($_POST['url'])) { $url=$_POST['url']; $query="UPDATE wp_options SET option_value='$url' WHERE option_name='siteurl'"; $result=$db->query($query); echo "THERE WERE <b>" . $db->affected_rows . "</b> ROWS IN THE DATABASE AFFECTED!<br/><br/>"; // Did the database query update anything? If so, then stop the application... if ($db->affected_rows != 0) { die("Be Sure To Delete This File From Your Server When Complete!!!"); } } // Query the current information in the database... $query="SELECT option_value FROM wp_options WHERE option_name='siteurl'"; $result=$db->query($query); $row=$result->fetch_object(); // Display the form and print out what is in the database... ?> <form action="sitereset.php" method="post"> <b>Site URL:</b> <input type="text" name="url" size="60" value="<?php echo $row->option_value ?>" /> <br /> <br /> <input type="submit" value="RESET WORDPRESS" /> </form>
Leave a Reply