WordPress.org

Forums

Lift: Search for WordPress
[resolved] Limiting indexed content types in v 1.3 (6 posts)

  1. bswen
    Member
    Posted 2 years ago #

    In version 1.2 it seemed the plugin only indexed pages and posts by default and I could add custom content types to index with, for instance:

    add_filter('lift_indexed_post_types', function( $post_types ){
        $post_types[] = 'audio';
        $post_types[] = 'video';
    }

    In version 1.3 the plugin indexes every content type by default.

    I had to do this to limit to just the content types I wanted indexed:

    add_filter('lift_indexed_post_types', function( $post_types ){
        unset($post_types);
        $post_types[] = 'audio';
        $post_types[] = 'video';
        $post_types[] = 'post';
        $post_types[] = 'page';
        return $post_types;
    });

    It seems to work, is this correct?

    Brady

    http://wordpress.org/extend/plugins/lift-search/

  2. prettyboymp
    Member
    Plugin Author

    Posted 2 years ago #

    In version 1.3, we changed it from being a hardcoded list of default post types to include all posts types where the 'exclude_from_search' property was false. That is the correct way to filter out the post types you don't want indexed within Lift, however, I would look at those other post types and figure out if they actually should have 'exclude_from_search' be set as true.

  3. bswen
    Member
    Posted 2 years ago #

    exclude_from_search is set where?

  4. prettyboymp
    Member
    Plugin Author

    Posted 2 years ago #

    It's an argument of the register_post_type() function. It defaults to whatever the 'public' argument is, which itself defaults to false. For more details, check out the codex, http://codex.wordpress.org/Function_Reference/register_post_type

  5. bswen
    Member
    Posted 2 years ago #

    Great, thanks.

  6. bswen
    Member
    Posted 2 years ago #

    Marking resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.