Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove Divi shortcodes from content
<?php
/**
* Remove Divi shortcodes from content
*
* @see http://victorfont.com/remove-divi-shortcodes-changing-themes/
*/
function remove_divi_shortcodes( $content ) {
$content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);
return $content;
}
@mohamdio

This comment has been minimized.

Copy link

commented Jan 27, 2018

What about this new plugin ( Shortcode Cleaner )
https://plugins.jozoor.com/shortcode-cleaner/
video demo: https://www.youtube.com/watch?v=dXVZ5bSUduc
It easily removes Divi shortcodes automatically when changing it to a new theme.
It removes unused, broken shortcodes from WordPress, so you can switch between themes and plugins without worrying and keep your content cleanly and fresh all the time, it is dealing with any theme (Divi, Avada, ..etc) shortcodes that are left when changing themes or plugins.

I think it will be useful for any site.

@rikmendes

This comment has been minimized.

Copy link

commented Sep 17, 2019

This plugins works really well. best solutions so far to move away from Divi/Avada etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.