Support » Plugin: Basic Google Maps Placemarks » [Plugin: Basic Google Maps Placemarks] Excluding from search results

  • For me, it doesn’t really make sense to have placemarks showing up in search results on my website.
    I’ve found it very easy to find out how to exclude them – a quick test and things seem to be working so I think I’ve got it right.
    But I wonder if this could be an option in the settings?

    (In case anyone is wanting to know how, go to core.php for the plugin, go to where the custom post type is registered, starts at line 482, then in $postTypeParams = array add ,'exclude_from_search' => true )

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ian Dunn


    If enough people request it then I’ll consider adding it as an option.

    Instead of editing the core files directly, you should use the bgmp_post-type-params filter. That way you can upgrade the plugin without having your customizations overwritten.

    I’d be grateful for adding the exclusion placemarks from search results, too

    I agree, they should be excluded from search.

    Plugin Author Ian Dunn


    You can use the bgmp_post-type-params filter to remove them from the search. The problem with making them excluded by default at this point is that other users are already relying on having them enabled by default, so it would create problems for them if it suddenly switched.

    Please make it an option. Not keen on editing files, and then the next upgrade wipes out the changes…

    Currently if I click on a placemark in the search results wordpress says not found. So from a user perspective, how does having placemarks in the search results help the user exactly?

    Plugin Author Ian Dunn


    Murray, you don’t need to edit the core files. You can create a callback function for the bgmp_post-type-params filter in a functionality plugin, or your theme, and it won’t be overwritten when you upgrade the plugin.

    Something like this should do it:

    function excludePlacemarksFromSearch( $params )
    	$params[ 'exclude_from_search' ] = true;
    	return $params;
    add_filter( 'bgmp_post-type-params', 'excludePlacemarksFromSearch' );


    Newbie here… If someone could tell me exactly where to put those few lines of code above, I would be so thankful!

    How is “a callback function” created? Where is the bgmp_post-type-params filter?

    I agree with Murray: no use for placemarks to be seen in search results, since if clicked there is no page associated with them.

    Thank you!

    (just to say that taggie’s method works, but I’ll avoid updates)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Basic Google Maps Placemarks] Excluding from search results’ is closed to new replies.