Delete class and item-sets search fields in the advanced search



we need to delete from the public view the fields of search by class and item-sets.
We would like to keep the only field search by value.
We work with Omeka-S 1.4.0 and the theme Center row

What files should we change in Omeka-S to do so ?
Many thanks,


Hi. I have created a quick frontend solution to remove fields from items advanced-search, using jQuery. It might be useful to you:

jQuery(document).ready(function($) {

Run it in console and see if it suits your needs. I have compiled it in a module; I could share it if you wish.



Hi, thanks for your reply.

In what file should I write this function ?

many thanks to share your module with me, perhaps is it in github ?



Now there is:


it works ! thanks a lot !


Hi kolydart,

I have spoken too fast. I putyour following code in the query request field of my Advanced-search page, but the item-sets ans resource-class fields are still there

“jQuery(document).ready(function($) {

Your module is well activated.

Is there another setting I should set up ?
Many thanks,


a) check jQuery is running by running the command I sent, in the browser console. Caution: the code you posted contains curly quotes, which will return errors. Here is a quick video.
b) make sure the .js file is accessible (yourdomain.tld/modules/hideAdvancedSearchElements/asset/advanced-search.js). If not, you did not install the module correctly
c) check the source code of the advanced search page and make sure it contains the link to the js file in the section. If not, the specified event listener is not correct. Please note, that the listener I have set is for backend advanced search (yourdomain.tld/admin/item/search).



I updated module repository. I attached a listener to frontend advanced search also.


OK, thanks, it works but now on the Site view, all fields have disappeared whereas we need to keep at least the field “research by value” active.

the .js file is well accessible.
I checked the source code on the Site view, here is the mention :


I download your new repository with the added mention on the module.ini file : $sharedEventManager->attach(
array($this, ‘advancedSearch’)

Another point :
Sorry for disturbing You because this question is not directly linked to Omeka S but when I have access to the code via the “inspector view” since the web development, how can I save my changes ?
For instance I would like to delete some nodes or rename properties. Since the “inspector view”, I changed those elements but it seems i can not save them.
So that when I go back on the site view, changes have not been taken into account. ==> I precise I tried this option before I downloaded your new repository as now I have no more any fields of research on my page.



That is the point of the console. You test your code on the console and when satisfied you store the code in a javascript file which is inserted in the html.
The javascript file to edit is /modules/hideAdvancedSearchElements/asset/advanced-search.js
– comment everything in advanced-search.js except the first & last line (they are used for maximum compatibility)
– run each jQuery command and view the result; for example $("#item-sets").remove();
– when you are satisfied with the result, save the commands in the advanced-search.js file
For more about jQuery selectors, see