wp_get_canonical_url


wp_get_canonical_url ( $post = null )

Parameters:
  • (int|WP_Post) post Optional. Post ID or object. Default is global `$post`.
Returns:
  • (string|false) The canonical URL. False if the post does not exist or has not been published yet.
Defined at:

Description

Returns the canonical URL for a post.When the post is the same as the current requested page the function will handle the pagination arguments too.

Related Functions

wp_admin_canonical_url, wp_nonce_url, rel_canonical, wp_get_original_image_url, wp_widget_control

Top Google Results

User discussions

wpseek mobile