• Hi,

    I want to remove all orphan shortcodes from my WP, mainly the WPG2 (Gallery2) shortcodes.

    I have a lot of entries with this, so i tried to search and replace with regEx with some plugins but i can’t do.

    My shortcodes is like this:

    <wpg2>3223523523523</wpg2>

    Any suggestion to massively remove? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator cubecolour

    (@numeeja)

    If you have uninstalled the plugin that processes the shortcodes, you can redefine the shortcode to output nothing by using a function that returns without outputting anything either in your functions.php or a custom plugin. eg:

    
    function cc_dummy_shortcode_wpg2() {
    	return;
    }
    add_shortcode( 'wpg2', 'cc_dummy_shortcode_wpg2' );
    

    The example function above should work for any [wpg2] shortcode, including [wpg2]3223523523523[/wpg2], however there would be a problem if your site really uses the angle bracket syntax you have shown in your example as this does not use square brackets so is not actually a shortcode.

    • This reply was modified 9 years, 6 months ago by cubecolour.
    Thread Starter xopox

    (@xopox)

    Hi cubecolour, thanks for your reply.

    Yes, as you can said, wpg2 uses square brackets and not angle bracket syntax 🙁

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Removing orphan shortcodes’ is closed to new replies.