Creating an Administrator Account on WordPress using MySQL

If you need to quickly create an admin account for a WordPress site, upload adminer.php to the root directory or log in to phpMyAdmin, and run this SQL command (SQL tab in phpMyAdmin): INSERT INTO `DATABASE_NAME`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘99999’, ‘username’, MD5(‘MakeABetterPassword’), ‘username’, ’email@gmail.com’, ”, NOW(), ”, […]

WordPress Debugging

define( ‘WP_DEBUG’, true ); if ( WP_DEBUG ) { define( ‘WP_DEBUG_DISPLAY’, false ); define( ‘WP_DEBUG_LOG’, true ); @ini_set( ‘display_errors’, 0 ); define( ‘SCRIPT_DEBUG’, true ); }

Changing WordPress Default “From” Email

add_filter(‘wp_mail_from’, function($email){     if( substr($email,0,10) === ‘wordpress@’)         $email = get_option(‘admin_email’);     return $email; }); add_filter(‘wp_mail_from_name’, function($name){     if($name === ‘WordPress’)         $name = str_replace( ‘’’, “‘”, get_option(‘blogname’) );     return $name; });

Incremental and Random Key Code Generator

function readycat_keygen( $atts ) {          extract( shortcode_atts(         array(             ‘len’ => null,             ‘char’ => ‘ABCDEFGHJKMNPQRSTUVWXYZ23456789’,// don’t bother with I L 1 O or 0             ‘type’ => ‘count’,             ‘countby’ => null,             ‘pre’ => null,            […]