1/21/2014 - 7:15 AM

WordPress reset Install

WordPress reset Install

// Simply type in the url in the text box to reset the WordPress site url.

// 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...

// Create a new database object...

// Was the form submitted?
if (isset($_POST['url'])) {

	$query="UPDATE wp_options SET option_value='$url' WHERE option_name='home'";	//or siteurl

	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='home'";	//or siteurl



// Display the form and print out what is in the database...


<form action="sitereset.php" method="post">
<b>Home URL:</b> <input type="text" name="url" size="60" value="<?php echo $row->option_value ?>" />
<br />
<br />
<input type="submit" value="RESET WORDPRESS" />