Title: WP_Icons_Registry::unregister
Published: August 20, 2026

---

# WP_Icons_Registry::unregister( string $icon_name ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#changelog)

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

Unregisters an icon.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#parameters)󠁿

 `$icon_name`stringrequired

Namespaced icon name in the form "collection/icon-name" (e.g. "core/arrow-left").

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

 bool True if the icon was unregistered successfully, false otherwise.

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

    ```php
    public function unregister( $icon_name ) {
    	if ( ! $this->is_registered( $icon_name ) ) {
    		_doing_it_wrong(
    			__METHOD__,
    			sprintf(
    				/* translators: %s: Icon name. */
    				__( 'Icon "%s" is not registered.' ),
    				$icon_name
    			),
    			'7.1.0'
    		);
    		return false;
    	}

    	unset( $this->registered_icons[ $icon_name ] );
    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-icons-registry.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-icons-registry.php#L210)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-icons-registry.php#L210-L226)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Icons_Registry::is_registered()](https://developer.wordpress.org/reference/classes/wp_icons_registry/is_registered/)`wp-includes/class-wp-icons-registry.php` |

Checks if an icon is registered.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_doing_it_wrong()](https://developer.wordpress.org/reference/functions/_doing_it_wrong/)`wp-includes/functions.php` |

Marks something as being incorrectly called.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_icons_registry/unregister/?output_format=md#)

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

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

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