8a614988 by Jeff Balicki

set_exclude_from_search

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent fb5a1a18
......@@ -42,3 +42,19 @@ function wptp_add_tags_to_attachments() {
add_action( 'init' , 'wptp_add_tags_to_attachments' );
add_action('init','set_exclude_from_search');
function set_exclude_from_search()
{
if ($_GET['var'] =='set_exclude_from_search') {
global $post;
$args = array( 'posts_per_page' => -1, 'post_status'=> 'publish', 'post_type' => 'page');
$pages = get_posts( $args );
foreach ( $pages as $page ){
update_post_meta($page->ID, 'exclude_from_search', 0 );
}
}
}
......