Created
October 13, 2016 00:40
-
-
Save d0ky/d794b5411629ac988e31575b44ddd1ab to your computer and use it in GitHub Desktop.
put it wp root folder reach it by the browser once to remove all visual composer tag from your db
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
<?php | |
// put it wp root folder reach it by the browser once to remove all visual composer tag from your db | |
// | |
echo'<pre>'; | |
// Include the wp-load'er | |
include('wp-load.php'); | |
$query = new WP_Query( array( 'posts_per_page' => '-1' ) ); | |
while ($query->have_posts()) : $query->the_post(); | |
//print_R( $post->post_title ); | |
$my_post = array( | |
'ID' => $post->ID, | |
'post_content' => preg_replace("/(\[(\/?)vc.*?\])/s", '', $post->post_content) | |
); | |
// Update the post into the database | |
wp_update_post( $my_post ); | |
echo '<br>'; | |
echo 'update product ID '.$post->ID; | |
endwhile; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment