Removing Plugins from Search Results

How can I remove certain plugins from the search results on elgg 1.7

For example, i'd like to remove results for the "File" plugin when doing a search, without removing the actual plugin.

I've been reading up on it and it looks like i need to write some kind of hook, but i'm unsure what and where this needs to be.  Any help out there?



  • commenting out this line in the plugin's start should do it: register_entity_type('object','file');

    Normally, I wouldn't recommend editing a plugin but there does not appear to be a unregister_entity_type() function available.

  • Re unregister_entity_type(): could be one to add since we've started introducing other unregister_*() functions...

  • Yep, that works, i'll just keep in mind this direct plugin change when i upgrade.  Thanks Cash!

  • Hi, i need to restict results of my file search, I just need to make a list with .doc and .pdf file extentions, How can I perform this change?

    I make this change just with php code ( external access) How can I integrate this to the defaul file search module.

    This is my implementation.

    SQL: I need to include in the file search:

    SELECT as idarchivo, a1.string ,a2.*, a3.username, a4.*   FROM elggmetastrings as a1, elggmetadata as a2, elggusers_entity as a3, elggobjects_entity as a4  WHERE( a1.string LIKE '%.doc%' OR   a1.string LIKE '%.pdf%' OR a1.string LIKE '%.ppt%' OR a1.string LIKE '%.xls%' OR a1.string LIKE '')  AND a1.string LIKE '%file/%' ";


    Tks 4 yours answers

  • Not sure if this is a good practice, but what I did was surround the:


    like this:

    if(isadminloggedin()){ register_entity_type('object','file');

    So it registers and shows up if admin is logged in. That way for search results, river filter and admin statistics page admin can see everything. But users can only see the entities you want them to.

  • I have similar problem - but with groups. I had a lot of group activity, now I've turned off groups plugin and groups search resoults are still visible. How to remove search in groups? (plugin groups id turned off now). All regarding elgg 1.7.1

  • solved ;)

    unset($types[group]); in mod/search/index.php