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, or 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_widget_control, _canonical_charset

Top Google Results

User discussions

wpseek mobile