[wp-trac] [WordPress Trac] #20283: Create new variable or function in $wp_query object to get canonical URL of any site's page
WordPress Trac
wp-trac at lists.automattic.com
Thu Mar 22 14:42:37 UTC 2012
#20283: Create new variable or function in $wp_query object to get canonical URL of
any site's page
-------------------------+-----------------------------
Reporter: egorpromo | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Canonical | Version: 3.3.1
Severity: normal | Keywords:
-------------------------+-----------------------------
For the sake of Search Engine Optimization it's recommended to set
canonical URL inside <link rel='canonical'> tag in any site's page.
Incorrect URL can exist in search engine index. For example:
http://example.com?some_param=some_val&cat=3,4. URL points to categories
with id equals 3 and 4, but we have another unnecessary parameter
'some_param'. It's malicious! We must set canonical URL to
http://example.com?cat=3,4.
So It's advance to have canonical URL generated some way. I propose to set
function or variable inside WP_Query class to retrieve canonical URL to
any opened page.
In WP_Query we have variable WP_Query::query which consists of all
necessary parameters for that propose. But we must use $wp_rewrites also.
Any thoughts?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20283>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list