Support » Networking WordPress » Images in internal search results

  • Resolved Irene


    I have two folder subsites with same settings and same plugin, all updated. In one of the subsites I see images in the internal search results.

    The only difference between theme is that the main url redirects to it. redirects to

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello Irene!

    What are you looking to do exactly with your two websites? Show the images in the search results or not show them.

    Please include the URL of your other website to compare them, and see what might be happening.

    Sorry, I don’t want images in the internal search results.
    Thanks in advance


    I found the solution for exclude images (attachments) from search results in WP internal search.

    Is this code snippet, using WordPress functionality
    The code must be add to functions.php:

    // Exclude images from search results - WordPress
    add_action( 'init', 'exclude_images_from_search_results' );
    function exclude_images_from_search_results() {
    	global $wp_post_types;
    	$wp_post_types['attachment']->exclude_from_search = true;

    I find very useful this plugin for adding code, instead of adding directly in the functions.php:

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Images in internal search results’ is closed to new replies.