Title: allowed_tags
Published: April 25, 2014
Last modified: May 20, 2026

---

# allowed_tags(): string

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#wp--skip-link--target)

Displays all of the allowed tags in HTML format with attributes.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#description)󠁿

This is useful for displaying in the comment area, which elements and attributes
are supported. As well as any plugins which want to display it.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#return)󠁿

 string HTML allowed tags entity encoded.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#source)󠁿

    ```php
    function allowed_tags() {
    	global $allowedtags;
    	$allowed = '';
    	foreach ( (array) $allowedtags as $tag => $attributes ) {
    		$allowed .= '<' . $tag;
    		if ( 0 < count( $attributes ) ) {
    			foreach ( $attributes as $attribute => $limits ) {
    				$allowed .= ' ' . $attribute . '=""';
    			}
    		}
    		$allowed .= '> ';
    	}
    	return htmlentities( $allowed );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/general-template.php#L2637)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/general-template.php#L2637-L2650)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | No longer used in core. | 
| [1.0.1](https://developer.wordpress.org/reference/since/1.0.1/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/allowed_tags/?output_format=md#comment-content-1767)
 2.   [rabmalin](https://profiles.wordpress.org/rabmalin/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/allowed_tags/#comment-1767)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fallowed_tags%2F%23comment-1767)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fallowed_tags%2F%23comment-1767)
 4. **Display allowed HTML tags**
 5.     ```php
        $allowed_html_tags = allowed_tags();
        echo $allowed_html_tags;
        ```
    
 6. Output:
 7.     ```php
        <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
        ```
    
 8.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fallowed_tags%2F%3Freplytocom%3D1767%23feedback-editor-1767)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fallowed_tags%2F)
before being able to contribute a note or feedback.