--- label: 'Managing text filters and text formats' related: - core.security - core.content_structure - field_ui.manage_form - field_ui.manage_display - field_ui.add_field --- {% set content_url = render_var(url('filter.admin_overview')) %}

{% trans %}Goal{% endtrans %}

{% trans %}Configure text formats on the site.{% endtrans %}

{% trans %}What are text filters and text formats?{% endtrans %}

{% trans %}A text filter is a processing step that can be applied to text, either to transform it in some way (such as converting URLs in the text into HTML links), or to defend against potentially-dangerous input from site users. A text format is an ordered sequence of text filters. Text filters are provided by modules; text formats are managed by the core Filter module.{% endtrans %}

{% trans %}Text fields that have "formatted" in the field type name, such as Text (formatted), use text formats. Users choose the text format when editing the field text; when the field text is shown on the site, it is processed by the chosen text format. Administrators can configure text formats and assign permissions for who can use each format. If the core Text Editor module is enabled, administrators can also associate visual editors with text formats.{% endtrans %}

{% trans %}What text filters are available?{% endtrans %}

{% trans %}Some of the more commonly used text filters are:{% endtrans %}

{% trans %}Limit allowed HTML tags and correct faulty HTML{% endtrans %}
{% trans %}Limits which HTML tags can be used; useful both for site security and enforcing site design.{% endtrans %}
{% trans %}Convert line breaks into HTML{% endtrans %}
{% trans %}Line breaks in HTML source are displayed as horizontal spaces. This filter converts line breaks into HTML paragraph and line break tags.{% endtrans %}
{% trans %}Convert URLs into links{% endtrans %}
{% trans %}Takes plain URLs in text and turns them into HTML links.{% endtrans %}
{% trans %}Restrict images to this site{% endtrans %}
{% trans %}For text formats that allow HTML image tags, restricts images to URLs within this site.{% endtrans %}

{% trans %}Steps{% endtrans %}

  1. {% trans %}In the Manage administrative menu, navigate to Configuration > Content Authoring > Text formats and editors. If you do not have the core Text Editor module installed, the menu link and page title will instead be Text formats.{% endtrans %}
  2. {% trans %}Click Configure to configure an existing text format, or + Add text format to create a new text format.{% endtrans %}
  3. {% trans %}Enter the desired Name for the text format.{% endtrans %}
  4. {% trans %}Check the Roles that can use this text format. Some HTML tags allow users to embed malicious links or scripts in text. To ensure security, anonymous and untrusted users should only have access to text formats that restrict them to either plain text or a safe set of HTML tags. Improper text format configuration is a security risk.{% endtrans %}
  5. {% trans %}If the core Text Editor module is installed, see the related topic to connect a text editor to this text format.{% endtrans %}
  6. {% trans %}Under Enabled filters, check the text filters that you want to use.{% endtrans %}
  7. {% trans %}Under Filter processing order, drag the filters to the correct order. Choose the order carefully; for example, if you have a filter that results in a particular HTML tag being added to the text, that should run after a filter that restricts HTML tags, to avoid deleting the new tags the first filter added.{% endtrans %}
  8. {% trans %}Under Filter settings, verify and adjust the settings for each active filter that has configuration options.{% endtrans %}
  9. {% trans %}Click Save configuration, which will return you to the Text formats and editors page.{% endtrans %}
  10. {% trans %}Repeat these steps if you have additional text formats to configure.{% endtrans %}