This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM wp_options WHERE option_name LIKE '_transient_%'; | |
DELETE FROM wp_comments WHERE wp_comments.comment_type = 'pingback'; | |
DELETE FROM wp_comments WHERE wp_comments.comment_type = 'trackback'; | |
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) | |
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RENAME table wp_commentmeta TO wp_NEWPREFIX_commentmeta; | |
RENAME table wp_comments TO wp_NEWPREFIX_comments; | |
RENAME table wp_links TO wp_NEWPREFIX_links; | |
RENAME table wp_options TO wp_NEWPREFIX_options; | |
RENAME table wp_postmeta TO wp_NEWPREFIX_postmeta; | |
RENAME table wp_posts TO wp_NEWPREFIX_posts; | |
RENAME table wp_terms TO wp_NEWPREFIX_terms; | |
RENAME table wp_term_relationships TO wp_NEWPREFIX_term_relationships; | |
RENAME table wp_term_taxonomy TO wp_NEWPREFIX_term_taxonomy; | |
RENAME table wp_usermeta TO wp_NEWPREFIX_usermeta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_posts SET post_content = replace(replace(replace(post_content, '“', '"'), '”', '"'), '’', ''''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add custom fields to user profiles | |
function vuurr_sm_contactmethods( $contactmethods ) { | |
// Add | |
$contactmethods['twitter'] = 'Twitter'; | |
$contactmethods['facebook'] = 'Facebook'; | |
$contactmethods['googleplus'] = 'Google+ About'; | |
// Remove | |
unset($contactmethods['yim']); | |
unset($contactmethods['aim']); | |
unset($contactmethods['jabber']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $user_login; | |
get_currentuserinfo(); | |
if (!current_user_can('update_plugins')) { /* checks to see if current user can update plugins */ | |
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); | |
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect Empty Searches to root | |
RewriteCond %{QUERY_STRING} ^s=$ | |
RewriteRule ^ /? [L,R=301] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is a settings export file for the WordPress SEO plugin by Yoast.com - http://yoast.com/wordpress/seo/ | |
[wpseo] | |
ignore_blog_public_warning = | |
ignore_tour = "ignore" | |
ignore_page_comments = | |
ignore_permalink = | |
ms_defaults_set = | |
version = "1.4.1" | |
tracking_popup = "done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enables the Link Manager that existed in WordPress until version 3.5 | |
add_filter( 'pre_option_link_manager_enabled', '__return_true' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('template_redirect', 'redirect_single_post'); | |
function redirect_single_post() { | |
if (is_search()) { | |
global $wp_query; | |
if ($wp_query->post_count == 1) { | |
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) ); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpbeginner_restrict_editing( $allcaps, $cap, $args ) { | |
// Bail out if we're not asking to edit or delete a post ... | |
if( 'edit_post' != $args[0] && 'delete_post' != $args[0] | |
// ... or user is admin | |
|| !empty( $allcaps['manage_options'] ) | |
// ... or user already cannot edit the post | |
|| empty( $allcaps['edit_posts'] ) ) | |
return $allcaps; |