Title: get_dynamic_block_names
Published: December 6, 2018
Last modified: February 24, 2026

---

# get_dynamic_block_names(): string[]

## In this article

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

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

Returns an array of the names of all registered dynamic block types.

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

 string[] Array of dynamic block names.

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

    ```php
    function get_dynamic_block_names() {
    	$dynamic_block_names = array();

    	$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
    	foreach ( $block_types as $block_type ) {
    		if ( $block_type->is_dynamic() ) {
    			$dynamic_block_names[] = $block_type->name;
    		}
    	}

    	return $dynamic_block_names;
    }
    ```

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

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

| Uses | Description | 
| [WP_Block_Type_Registry::get_instance()](https://developer.wordpress.org/reference/classes/wp_block_type_registry/get_instance/)`wp-includes/class-wp-block-type-registry.php` |

Utility method to retrieve the main instance of the class.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/get_dynamic_block_names/?output_format=md#comment-content-3175)
 2.   [rabmalin](https://profiles.wordpress.org/rabmalin/)  [  7 years ago  ](https://developer.wordpress.org/reference/functions/get_dynamic_block_names/#comment-3175)
 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%2Fget_dynamic_block_names%2F%23comment-3175)
    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%2Fget_dynamic_block_names%2F%23comment-3175)
 4.     ```php
        // Fetch block names.
        $block_names = get_dynamic_block_names();
    
        // Output.
        Array
        (
            [0] => core/block
            [1] => core/latest-comments
            [2] => core/archives
            [3] => core/calendar
            [4] => core/categories
            [5] => core/latest-posts
            [6] => core/rss
            [7] => core/search
            [8] => core/shortcode
            [9] => core/tag-cloud
        )
        ```
    
 5.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_dynamic_block_names%2F%3Freplytocom%3D3175%23feedback-editor-3175)

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