I need to remove all the divs inside the $widget of a views exposed filter. I need only the single form fields without any html around it.

I don't know PHP.

Any suggestions?

3 Answers 3


All you need to do is simple override your own theme page for the expose filter views/theme/views-exposed-form.tpl.php to you theme template folder e.g.


Example: views-exposed-form--latest_nodes--page.tpl.php

and remove which you wold like to or adding your own.


Go to the modules directory and look for the 'views' module.

There is a 'theme' folder within this.

In the theme folder, copy the 'views-exposed-form.tpl.php' file to your theme.

You can then edit the template as you require.

Note, when you copy a file like this you will want to clear caches for this to work.


To edit specific components of the form I suggest you override the following function in your themes template.php file.


This can also be found in the views module folder 'theme.inc'.

  • This file I'm currently editing. But contains the <?php print $widget->widget; ?> which outputs the whole form. And I need to edit this form WITHIN the $widget.
    – deelite
    Jan 6, 2015 at 10:17
  • See updated answer.
    – Alex Gill
    Jan 6, 2015 at 10:29
  • Could you please explain me how to simply output the input fields without any other html? Sorry, I don't get it.
    – deelite
    Jan 6, 2015 at 11:26
  • It isn't that simple I'm afraid. Each form component is constructed individually through the theme function. You need to strip it down by overriding these particulars.
    – Alex Gill
    Jan 6, 2015 at 11:57

You can also do easy css tricks :

.class-of-elements-you-want-to-hide {
   display: none;
  • The OP is asking how to remove them, not how to hide them. The other answers are correct, even if they cannot be as much specific as the OP wished.
    – apaderno
    Jan 27, 2017 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.