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

---

# apply_filters( ‘get_the_guid’, string $post_guid, int $post_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/get_the_guid/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/get_the_guid/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/get_the_guid/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/get_the_guid/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/get_the_guid/?output_format=md#changelog)

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

Filters the Global Unique Identifier (guid) of the post.

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

 `$post_guid`string

Global Unique Identifier (guid) of the post.

`$post_id`int

The post ID.

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

Note that the filter callback function must return the guid after it is finished
processing, or any code using the guid (for example: RSS feeds) will break, and 
other plugins also filtering the guid may generate errors.

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

    ```php
    return apply_filters( 'get_the_guid', $post_guid, $post_id );
    ```

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

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

| Used by | Description | 
| [WP_REST_Revisions_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_revisions_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php` |

Prepares the revision for the REST response.

  | 
| [WP_REST_Posts_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Prepares a single post output for response.

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

Retrieves the Post Global Unique Identifier (guid).

  |

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

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

## User Contributed Notes

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