Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Delete .htaccess per plugin
<?php # -*- coding: utf-8 -*-
* Plugin Name: Delete .htaccess
* Description: Deletes the .htaccess file on activation, deactivates itself then.
* Plugin URI:
* Version: 2012.07
* Author: Thomas Scholz
* Author URI:
* License: MIT
* License URI:
* Delete .htaccess, Copyright (C) 2012 Thomas Scholz
register_activation_hook( __FILE__, 'wpse_58183_delete_htaccess' );
add_action( 'admin_notices', 'wpse_58183_admin_notice' );
function wpse_58183_delete_htaccess()
$root = trailingslashit( $_SERVER['DOCUMENT_ROOT'] );
unlink( $root . '.htaccess' );
function wpse_58183_admin_notice()
echo '<div class="updated"><p><code>.htaccess</code> deleted.<br>Plugin deactivated.</p></div>';
deactivate_plugins( basename( __FILE__ ) );

Download as ZIP file from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.