Delete the Hello Dolly plugin

This is part of a set of scripts that I was writing to setup WordPress the way I want.

This one deleted the Hello Dolly plugin, the script has to go in the root where wordpress was installed (in beside the config, htaccess files). This was tested on XAMPP on a Windows machine.

<?php
include “wp-load.php”;
require_once(‘wp-blog-header.php’);
require_once(‘.\wp-admin\includes\plugin.php’);
require_once(‘.\wp-admin/includes/file.php’);

if (file_exists(WP_PLUGIN_DIR . ‘/hello.php’))
{
delete_plugins(array(‘hello.php’));
echo “Hello Dolly deleted”;
}
?>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*