If you are a WordPress developer, you should have face this issue. In shortcodes, you sometimes may see the p tag and for this reason you code does not work as you want. I will show you how to fix this and it’s super easy. Just copy the following code snippets and paste it in your theme’s functions.php file and save it. The magic is done, now everything should be okay.

if( !function_exists('apbd_fix_shortcodes') ) {
    function apbd_fix_shortcodes($content){
        $array = array (
            '<p>[' => '[',
            ']</p>' => ']',
            ']<br />' => ']'
        $content = strtr($content, $array);
        return $content;
    add_filter('the_content', 'apbd_fix_shortcodes');