Skip to content

Instantly share code, notes, and snippets.

@kwcjr
Created November 27, 2021 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwcjr/4f67635dac007abf53d1cebf7a5c0487 to your computer and use it in GitHub Desktop.
Save kwcjr/4f67635dac007abf53d1cebf7a5c0487 to your computer and use it in GitHub Desktop.
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