Skip to content

Instantly share code, notes, and snippets.

@dannyockilson
Created May 27, 2014 17:18
Show Gist options
  • Save dannyockilson/cbaad776def292aa2413 to your computer and use it in GitHub Desktop.
Save dannyockilson/cbaad776def292aa2413 to your computer and use it in GitHub Desktop.
SQL Queries for Wordpress
/* Switch off comments and remove for already created posts */
UPDATE {{database}}.{{prefix}}posts SET comment_status = 'closed' WHERE comment_status = 'open';
UPDATE {{database}}.{{prefix}}options SET option_value = 'closed' WHERE option_name = 'default_comment_status';
/* Lost password on localhost/no mail server */
UPDATE {{database}}.{{prefix}}users
SET password = MD5('{{password}}')
WHERE user_id = 1; /* normally replace with relevant user ID */
/* Somethings broke - deactivate all plugins and use default theme */
/* First deactivate all plugins */
UPDATE {{database}}.{{prefix}}options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';
/* if that doesn't work set to twenty thirteen default theme (use fourteen if you'd rather or any year really) */
UPDATE {{database}}.{{prefix}}options SET option_value = 'twentythirteen' WHERE option_name = 'template';
UPDATE {{database}}.{{prefix}}options SET option_value = 'twentythirteen' WHERE option_name = 'stylesheet';
UPDATE {{database}}.{{prefix}}options SET option_value = 'Twenty Thirteen' WHERE option_name = 'current_theme';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment