Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Delete WP readme.html
/**
* Delete WP readme.html file remotely.
*
* This snippet will delete the readme.html file from your Child Site root dir.
*
* @snippetType: Return info from Child Site.
*/
// Load in WP Core files we need.
include_once(ABSPATH . WPINC . '/functions.php');
include_once(ABSPATH . WPINC . '/plugins.php');
$file_path = ABSPATH . 'readme.html'; // path of the file which need to be deleted.
wp_delete_file( $file_path ); //delete file here.
echo 'File ' . $file_path . ' has been deleted.'; // Echo result to screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment