Support » Fixing WordPress » Shortcodes appearing in archive and index pages

  • I am having a huge issue with shortcodes—they are appearing in all of my index and archive pages. When I add the

    add_filter('the_content', 'strip_shortcodes');
    function remove_shortcode_from_index($content) {
      if ( is_home() ) {
        $content = strip_shortcodes( $content );
      return $content;

    code to my functions.php, it only removes the shortcode (i.e. image and caption) on my actual post page. I just need this code to be removed from archive and search result pages.

    Currently I have the site ‘under construction’ because of this error. If you need to see the page, contact me please and I can give you access.

    Any help is appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Shortcodes appearing in archive and index pages’ is closed to new replies.