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

---

# do_action( ‘dynamic_sidebar_after’, int|string $index, bool $has_widgets )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/dynamic_sidebar_after/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/dynamic_sidebar_after/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/dynamic_sidebar_after/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/dynamic_sidebar_after/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/dynamic_sidebar_after/?output_format=md#changelog)

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

Fires after widgets are rendered in a dynamic sidebar.

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

Note: The action also fires for empty sidebars, and on both the front end and back
end, including the Inactive Widgets sidebar on the Widgets screen.

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

 `$index`int|string

Index, name, or ID of the dynamic sidebar.

`$has_widgets`bool

Whether the sidebar is populated with widgets.
 Default true.

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

    ```php
    do_action( 'dynamic_sidebar_after', $index, true );
    ```

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

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

| Used by | Description | 
| [dynamic_sidebar()](https://developer.wordpress.org/reference/functions/dynamic_sidebar/)`wp-includes/widgets.php` |

Displays dynamic sidebar.

  |

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

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

## User Contributed Notes

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