Title: wp_meta
Published: April 25, 2014
Last modified: August 20, 2026

---

# wp_meta()

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#description)
 * [More Information](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#user-contributed-notes)

Theme container function for the ‘wp_meta’ action.

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

The [‘wp_meta’](https://developer.wordpress.org/reference/hooks/wp_meta/) action
can have several purposes, depending on how you use it, but one purpose might have
been to allow for theme switching.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#more-information)󠁿

 * By default, `wp meta()` is called immediately after [`wp_loginout()`](https://developer.wordpress.org/reference/functions/wp_loginout/)
   by `sidebar.php` and the Meta widget, allowing functions to add new list items
   to the widget.
 * As the `get_sidebar( $name );` function has the `do_action( 'get_sidebar', $name);`
   on top before it loads the sidebar file, this hook should be used to load stuff
   _before_ the sidebar and `wp_meta();` should be called at the end of the sidebar
   template to allow adding callbacks after the sidebar.

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

    ```php
    function wp_meta() {
    	/**
    	 * Fires before displaying echoed content in the sidebar.
    	 *
    	 * @since 1.5.0
    	 */
    	do_action( 'wp_meta' );
    }
    ```

[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.1/src/wp-includes/general-template.php#L949)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/general-template.php#L949-L956)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#hooks)󠁿

 [do_action( ‘wp_meta’ )](https://developer.wordpress.org/reference/hooks/wp_meta/)

Fires before displaying echoed content in the sidebar.

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

| Uses | Description | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  |

| Used by | Description | 
| [WP_Widget_Meta::widget()](https://developer.wordpress.org/reference/classes/wp_widget_meta/widget/)`wp-includes/widgets/class-wp-widget-meta.php` |

Outputs the content for the current Meta widget instance.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_meta/?output_format=md#comment-content-1318)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_meta/#comment-1318)
 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%2Fwp_meta%2F%23comment-1318)
    Vote results for this note: 2[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%2Fwp_meta%2F%23comment-1318)
 4. **Basic Example**
 5. Add a favourite link to the Meta widget:
 6.     ```php
        function wpdocs_my_meta_link() {
        	echo '<li><a href="http://www.example.com"&gt;' . __( 'My Favourite Link', 'textdomain' ) . '</a></li>';
        }
        add_action( 'wp_meta', 'my_meta_link' );
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_meta%2F%3Freplytocom%3D1318%23feedback-editor-1318)

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