Articles of rel canonical

Configuring Home Page Address

I though this was a simple issue. When i type in the browser: www.example.com it changes to: www.example.com/home/ This delivers the proper contents from the Home page, but i wish to stay showing the www.example.com address. I’ve configured %postnames% as Permalink, and setting the Static Front Page as the page Home through the Customizer. Also, […]

Why isn't the canonical link element used for all pages?

The canonical link element isn’t set for all pages. For example, if I look at the source code for a post, I can see the following in the <head>: <link rel=’canonical’ href=’http://example.com/post-name/’ /> However, if I look at the source code for an author archive page, I don’t see the link element. Why isn’t the […]

WordPress within a subdirectory of another WordPress environment doesn't work

Here’s a summary of my scenario: I’m running WordPress on a linux environment The root directory contains and index.php file that references the subdirectory where my main site’s files are (codex link). Let’s say this site is example.com Example.com works fine and pulls up the content that I have stored in my subfolder /foo I […]

WP didn't redirect to canonical category URL

I have a problem with canonical redirect. mydomain.com/mycat is the correct category URL but the following URL works too: – mydomain.com/asdfa/mycat – mydomain.com/1234/mycat – mydomain.com/anythingyouwant/mycat And all these URLs show the category mycat… The canonical is mydomain.com/mycat and now Google give results with bad URLs. Can you please help me because I didn’t understand why. […]

After changing siteurl ,home url form database it shows 3/4 errors called

Notice: Undefined index: host in /home/bhavani/public_html/wp-includes/canonical.php on line 444

WordPress Redirecting Non Category Pages /page/nnn to their Canonical URLs

I seemingly to have a strange issue I have found in almost every other WordPress site. Suppose, you have set your Blog home to a static WP page /myhome. And you have a separate page for blog /blog. Now, this works fine and should be: /blog /blog/page/2 /blog/page/3 /blog/page/4 But, for all other pages, e.g. […]

remove rel=next on home page but not others

There is a major problem with most new templates for WordPress that want you to set your homepage to Your Latest Posts. This is to enable many of the great theme features to work. The problem with this is that the front page (even though not a blog page) is seen as a paged entity […]

How to bulk edit canonical url's in SQL?

I’ve been assigned to edit the canonical URL’s (rel=”canonical” found in the head)of about 600 posts on a client’s site. Not all of the posts will use the same canonical url. Nor are these 301’s or 302’s. I’m told not to use a plugin because I would have to edit each post one at a […]

add the post as canonical for attachment page wordpress

the attachment page should have canonical added to the main post on attachment page (image.php) I currently have (automatically added by All in One Seo Pack): <link rel=”canonical” href=”https://example.com/main-post/image-name” /> And I want to change it to point to the post (where this image is attached) <link rel=”canonical” href=”https://example.com/main-post” /> You can ignore All in […]

Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445

After changing siteurl ,home url form database it shows 3/4 errors called Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445 Notice: Undefined index: scheme in /var/www/html/wp-includes/canonical.php on line 465 Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 444 Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 444 I have no idea whats wrong with […]