Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


How can I exclude certain groups or pages from appearing as results of a search? (e.g., the RecentChanges pages or the PmWiki group)


This recipe superseded in PmWiki 2.0 by SearchPatterns

To exclude a group such as "PmWiki" from appearing in the search results, add the following line to local/config.php or a PerGroupCustomization file:

    $SearchExcludePatterns[] = '/^PmWiki\\./';

To exclude specific page names (such as "RecentChanges") from appearing in the search results, add:

    $SearchExcludePatterns[] = '/\\.(All)?RecentChanges$/';

In general you can use any regular expression to list page names that should be excluded from the search.

See Also


  • Pm, added 2-Mar-2004


Knowing next to nothing about regular expressions, I tried to exclude several pages with the following line:

   $SearchExcludePatterns[] = '(/\\.(All)?RecentChanges$/)|(/\\.(All)?SearchWiki$/)|(/\\.(All)?RecentUploads$/)';

Unfortunately, that doesn't work:

   Warning: Unknown modifier '|' in /pmwiki/scripts/search.php on line 80

What would the correct syntax be for a multiple exclusion? --Henning

$SearchExcludePatterns is an array, so you can do multiple entries without needing the '|':

    $SearchExcludePatterns[] = '/\\.(All)?RecentChanges$/';
    $SearchExcludePatterns[] = '/\\.(All)?SearchWiki$/';
    $SearchExcludePatterns[] = '/\\.(All)?RecentUploads$/'; 

However, if you want to do them all in a single pattern, you can use:

    $SearchExcludePatterns[] = 


Thanks! It's working now! :-)

--Henning pmwiki-2.3.7 -- Last modified by {{simon}}

from IP: ip should be disabled by default for security reasons