wordpress手机主题删除短代码

I have a site where the shortcodes are appearing in the mobile version of the site. I want to remove them. When I add the below code, it strips out the shortcode and also the text along with it. I want a way to simply ignore the shortcode and leave the text.

Example: "[dropcarp2]G[/dropcap2]o and get a drink" Should appear as "Go and get a drink", but on a mobile device appears as "o and get a drink"(i.e. all text between the shortcode is removed).

Can anyone help?

I have been to functions.php in the mobile theme and added the following lines of code:

function my_shortcode_handler( $atts, $content=null, $code="" )
{
    return '';
}

//override the 'dropcap2' shortcode
add_shortcode('dropcap2', '__return_false');
add_shortcode('two_thirds', '__return_false');
add_shortcode('one_third', '__return_false');
add_shortcode('divider_1', '__return_false');
add_shortcode('services', '__return_false');
add_shortcode('one_third_last', '__return_false');

You may need to filter 'the_content' and strip all the shortcode from there:

EXAMPLE:

add_filter( 'the_content', 'str_replace_shortcode', 1 );
function str_replace_shortcode( $content ) {
   $content = str_replace(
        array( '[dropcarp2]', '[/dropcarp2]' ), // Put everything in the array
        '', $content );

  return $content;
}

Give it a try