Title: is_month
Published: April 25, 2014
Last modified: February 24, 2026

---

# is_month(): bool

## In this article

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

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

Determines whether the query is for an existing month archive.

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

For more information on this and similar theme functions, check out the [ Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/)
article in the Theme Developer Handbook.

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

 bool Whether the query is for an existing month archive.

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

    ```php
    function is_month() {
    	global $wp_query;

    	if ( ! isset( $wp_query ) ) {
    		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
    		return false;
    	}

    	return $wp_query->is_month();
    }
    ```

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

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

| Uses | Description | 
| [WP_Query::is_month()](https://developer.wordpress.org/reference/classes/wp_query/is_month/)`wp-includes/class-wp-query.php` |

Determines whether the query is for an existing month archive.

  | 
| [__()](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/functions/is_month/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/is_month/?output_format=md#)

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

Returns document title for the current page.

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

Retrieves the archive title based on the queried object.

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

Redirects incoming links to the proper URL based on the site url.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/is_month/?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/is_month/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/is_month/?output_format=md#comment-content-1615)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/is_month/#comment-1615)
 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%2Fis_month%2F%23comment-1615)
    Vote results for this note: -1[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%2Fis_month%2F%23comment-1615)
 4. **Check if current archive is month archive.**
 5.     ```php
        if ( is_month() ) {
        	// Do awesome.
        }
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_month%2F%3Freplytocom%3D1615%23feedback-editor-1615)

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