Skip to content

Instantly share code, notes, and snippets.

@bpmore
Created April 6, 2017 03:11
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save bpmore/85f5a32096218382fbb946d1f1166fb5 to your computer and use it in GitHub Desktop.
Save bpmore/85f5a32096218382fbb946d1f1166fb5 to your computer and use it in GitHub Desktop.
remove fusion builder shortcodes
<?php
add_filter('the_content', 'remove_fusion_shortcodes', 20, 1);
function remove_fusion_shortcodes( $content ) {
$content = preg_replace('/\[\/?fusion.*?\]/', '', $content);
return $content;
}
?>
**Tested with WP All Import and Export**
@ThomasPof
Copy link

Sometimes, there is a [fusion_code]...[/fusion_code] shortcake. You'd better change your regex for /\[fusion_code\].*\[\/fusion_code\]|\[\/?fusion.*?\]/ (I'm not the best regex-dev, but this one works!)

@lucagiai
Copy link

Please can you help me to understand how can i use this code? I want to move from a very old version of AVADA to Divi, and I want to remove all the [fusion_builder... ] shortcodes. It looks like this tiny snippet can do the job, but I really don't know how to use it.

Thanks! Regards

@ThomasPof
Copy link

Hello lucagiai,
It's not the best place to look for this kind of help, you should go to a forum rather than on GitHub.
But if you want to use this code, you should copy the code between the tags and past it inside your child theme's function.php file.
Have fun
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment