[SOLVED][Drupal Views] How to remove the descriptive text beneath the exposed filter in a View?

| | 2 min read

A Drupal user expressed interest in wanting to know how to remove the descriptive text beneath the exposed filter in a View. If you are facing the same question with Drupal Views in your Drupal site and want to know how to remove the descriptive text beneath the exposed filter in a View then continue reading to know more.

Here are the steps suggested by a few Drupal users.

  • The easiest way to do that would be to define the string of your choice to be empty in settings.php. For example if the string to be removed is "Enter a comma separated list of user names" then you could use the sample code below.
    /**
     * String overrides:
     *
     * To override specific strings on your site with or without enabling locale
     * module, add an entry to this list. This functionality allows you to change
     * a small number of your site's default English language interface strings.
     *
     * Remove the leading hash signs to enable.
     */
    # $conf['locale_custom_strings_en'][''] = array(
    #   'forum'      => 'Discussion board',
    #   '@count min' => '@count minutes',
    # );
    $conf['locale_custom_strings_en'][''] = array(
      'Enter a comma separated list of user names.' => '',
    );
  • However this is not a clean solution as you would not want code like this to be in your settings.php file and the example above should be used only for understanding the method.
  • Other elegnant 'Drupal' solutions would be to use the hook_form_views_exposed_form_alter()
  • The text could also be removed at the theme level with a preprocess function or a custom.tpl.php
  • Finally you could try disabling the text via CSS using a display:none on the div containing the text

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more.