Hi, Jake…
Any plans to update it to the current WordPress version. It’s a very useful plugin. Please consider an update. Thanks!
?No es posible aplicar una regla que defina automáticamente la url de cada archivo pdf como su url canónica, sin definir una por una la url canónica de cada archivo?
]]>Hi there,
Please, see the error message:
PHP Warning: Invalid argument supplied for foreach() in /home/241661.cloudwaysapps.com/rcjjtwcpch/public_html/wp-admin/includes/media.php on line 1813
the developer’s note:
“We have canonical-attachments plugin, which hooks into attachment_fields_to_edit and in some conditions, e.g. when the attachment is image returns nothing, which causes those notices.
To get everything working, the return statement must be outside of the if statement.”
and the part of the code responsible for the issue:
Please, let me know if we can expect a fix with the next update.
Many thanks!
]]>Hi,
I am looking for a solution for adding Canonical links to images. I have used the same image on a number of posts so when adding a canonical link will it break things if I link the same picture as a canonical link to different posts or is the rule 1 picture 1 post?
I am also looking for a solution to add Canonical links to patented posts. i.e
Blog/Page2 I want to add Canonical link to Blog/
Will your plugin solve both of these?
]]>Hi there,
Thank you for the great plugin.
I noticed an issue in “attachment_fields_to_edit” callback from
Please ally the fix on you next update.
Thanks.
]]>Hello!
1. I was looking for this for years. We have a lot of pdf’s and the url in search engines is a huge problem which is still not resolved. This plugin looks like a blessing.
2. I am a bit confused by how it should work in correspondence with Yoast Seo setting “redirect attachement URL to the parent post URL”.
As far as I understand, Yoast Seo does following: a) each file uploaded to wordpress has the file url and a separate “attachement page” url, which is practically a double. b) Yoast Seo makes a redirect, which links the attachement URL to the file URL.
Canonical plugin does following: it works only with pdf and docs (not with images by some reason), and tells to google that instead of the file at the search engine results page it should link to the post in which the file is embed (at least in my case, we embed the pdf into the parent posts via iframe, but it could be a link from the parent post to the pdf file, for exapmle, for other sites). Thus if a visitor uses google to find the pdf, if we are lucky, google will show a link to the parent post (which is much better for user engagement than raw pdf, besides google analytics). And thus it doesn’t contradict to Yoast Seo as they do parallel functions, being complementary to each other. One deletes the attachements pages and the second one influences the files.
Could you tell if I am right?
*Maybe this clarification would be useful in the plugin description as many users like me are dazzled by Yoast descriptions.
3. Am I right that the reason to use canonical for images is that if the attachement url is redirected to the file, the images are practically “canononical” to the parent post, as it is the place where they have readable by google meta data? Not sure if the link to the “parent” post (named “uploaded to”) in the media library does something practicall in such case, or if does influence somehow?
Sorry that the question is only partly connected with the plugin functions. You are clearly an expert in the question, and I was trying to find an info about it for such a long time…
4. Feedback: bulk edit function is very useful, as well as the option to add the links to all media which has the parent ones. Special thanks for that!
]]>It doesn’t appear that the canonical information is affecting my PDF. Both the PDF and the original webpage are still indexed in Google results. I have set up the plugin so that my htaccess file has the following entry:
# BEGIN Canonical 4028
<Files “MyFile.pdf”>
Header add Link “<https://www.website.com/my-webpage/>; rel=\”canonical\””
</Files>
#End Canonical 4028
However, when I fetch the PDF as Google in Google Search Console, the downloaded HTTP response reads:
# BEGIN Canonical 4028
<Files “MyFile.pdf”>
Header add Link “<https://www.website.com/my-webpage/>; rel=\”canonical\””
</Files>
#End Canonical 4028
HTTP/1.1 200 OK
Server: nginx
Date: THE DATE
Content-Type: application/pdf
Content-Length: NUMBER
Last-Modified: THAT DATE
Connect: keep-alive
Keep-Alive: timeout=20
ETAG: “SOME NUMBER”
X-Type: static/known
Cache-Control: public, max-age=SOMENUMBER
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Accept-Ranges: bytes
Followed by garbled text from the PDF.
]]>I am responding to a topic in my plugin’s support forum:
I installed and tested Cannonical Attachments and discovered this problem on lines 80-88 of canonical-attachments.php
:
// This processes the post back from the media pages
function can_attach_update_media_canonical($post, $attachment){
if( isset( $attachment['canonical-url'] ) ) {
$canonical = $attachment['canonical-url'];
$id = $post['ID'];
can_attach_update_single_canonical($id, $canonical);
}
}
add_filter( 'attachment_fields_to_save', 'can_attach_update_media_canonical', 10, 2 );
All WordPress filters must return a value corresponding to their first input parameter, in this case, $post
. Failure to do so causes all sorts of problems. In this case failure to return $post
makes it impossible to make any updates on the Media/Edit Media screen.
It looks like there are a number of filters in this file that do not return the proper values.
]]>Dear hivedigital Team,
thank you for developing this. Especially because it is a very “special” plugin and fits into a niche of users… but is so useful.
Well done so far and I hope to see updates in the future!
Cheers,
Philipp
]]>