Title: wp_unregister_ability
Published: February 24, 2026

---

# wp_unregister_ability( string $name ): 󠀁[WP_Ability](https://developer.wordpress.org/reference/classes/wp_ability/)󠁿|null

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#changelog)

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

Unregisters an ability from the Abilities API.

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

Removes a previously registered ability from the global registry. Use this to disable
abilities provided by other plugins or when an ability is no longer needed.

Can be called at any time after the ability has been registered.

Example:

    ```php
    if ( wp_has_ability( 'other-plugin/some-ability' ) ) {
        wp_unregister_ability( 'other-plugin/some-ability' );
    }
    ```

### 󠀁[See also](https://developer.wordpress.org/reference/functions/wp_unregister_ability/?output_format=md#see-also)󠁿

 * [WP_Abilities_Registry::unregister()](https://developer.wordpress.org/reference/classes/WP_Abilities_Registry/unregister/)
 * [wp_register_ability()](https://developer.wordpress.org/reference/functions/wp_register_ability/)

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

 `$name`stringrequired

The name of the ability to unregister, including namespace prefix (e.g., `'my-plugin/
my-ability'`).

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

 [WP_Ability](https://developer.wordpress.org/reference/classes/wp_ability/)|null
The unregistered ability instance on success, `null` on failure.

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

    ```php
    function wp_unregister_ability( string $name ): ?WP_Ability {
    	$registry = WP_Abilities_Registry::get_instance();
    	if ( null === $registry ) {
    		return null;
    	}

    	return $registry->unregister( $name );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/abilities-api.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/abilities-api.php#L324)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/abilities-api.php#L324-L331)

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

| Uses | Description | 
| [WP_Abilities_Registry::get_instance()](https://developer.wordpress.org/reference/classes/wp_abilities_registry/get_instance/)`wp-includes/abilities-api/class-wp-abilities-registry.php` |

Utility method to retrieve the main instance of the registry class.

  |

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

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

## User Contributed Notes

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