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.

LANGKAH PERTAMA: Copy kode di bawah ini dan buat file baru dengan nama sitereset.php.
<?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>
LANGKAH KEDUA: Upload file tersebut via FTP atau Cpanel ke dalam halaman folder root WordPress yang telah Anda install sebelumnya.
LANGKAH KETIGA: Buka browser dan akses situs Anda dengan menambahkan link file tadi.  (misal. http://www.namasitusanda.com/sitereset.php)
LANGKAH KEEMPAT: Masukkan alamat url situs yang benar pada kolom text tersebut.
LANGKAH KELIMA: Setelah selesai, segera hapus file sitereset.php tadi. Selesai
Sekarang situs wordpress anda kembali normal seperti semula. Selamat mencoba, semoga bermanfaat.
sumber : http://www.allancollins.net/200/wordpress-reset-reset-the-site-url/

Comments

7 responses to “Cara Reset WordPress Link”

  1. kodenya mana bang?

  2. terima kasih banyak mas, bermanfaat sekali, kebetulan sy sedang mengalami kasusnya..

    1. alhamdulillah… terimakasih sudah berkunjung

  3. Terimakasih ya gan. ane berhasil coba skrip agan (y)

    1. sama-sama gan, terimakasih sudah mampir dan komen

  4. gan ane hnya ngalamin tampilan web ane kacau balau tp desboardnya masih normal ,mohon solusionya gan.

    1. copy ulang file wordpress gan dari cpanel, jangan lupa backup file wp-config.php dan restore kembali

Leave a Reply