Maybe related to issue #116
I'm using WPML and on category / archive pages the:
<link rel="canonical" ...
URLs are missing the language subfolder in the URL and so pointing to non-existing sites => 404 Error !!
Can be seen on the WPML and The SEO Framework Compatibility Test Website
http://theseoframeworkplugin.compatibility.wpml.org/sr/category/uncategorized-sr/
the link is shown as
<link rel="canonical" href="http://theseoframeworkplugin.compatibility.wpml.org/category/uncategorized-sr/"> and so pointing to a non-existing site (the "/sr/" is missing - see link above)
Thanks for reporting this critical bug! I'll get right to it 馃憤
Nice to see your fast reaction.
As workaround I use this hook:
add_filter( 'the_seo_framework_rel_canonical_output', function() {
global $wp;
// get correkt url
$current_url = esc_url( home_url( add_query_arg( array(), $wp->request ) ) );
// check and maybe add trailing slash
return trailingslashit( $current_url );
});
I don't like the use of $wp->request, as it can pretty much contain anything, and some different requests can lead to one of the same page (i.e. duplicated content). Backlinks can act unfriendly on such implementation.
So the fix won't contain that, but it's a good workaround non-the-less 馃憤.
@michakrapp Could you test the patch?
Direct download:
https://github.com/sybrew/the-seo-framework/archive/d48004a49b146b21b86605ac744b058e60963687.zip
Note that the plugin's normally stored at /wp-plugins/autodescription/.
Thanks!
Sorry for the delay.
I've tested with your patch and the updatet version 2.9.2 and the error still exists.
The canonical link of categories (woocommerce product category, with rewritten name by wpml) still missing the language subdirectory in the URL.
<link rel="canonical" href="http://mysite.de/product-category/konfigurator/">
should be
<link rel="canonical" href="http://mysite.de/de/produkt-kategorie/konfigurator/">
My fix from above outputs the correct url.
It works for me, but I have to manually set the category base:

I'll look into what causes the translation of the base, and why it isn't picked up when unspecified.
Alright, I looked into it, and it seems that simply flushing the permalink structure does the trick.
I found that the WP_Rewrite base for product categories didn't contain the new values, so The SEO Framework couldn't pull them from the database.
The flushing is handled at only one point within the WPML for WooCommerce plugin, and it will eat up my whole day looking for other points as the plugin has dependencies.
@michakrapp Could you advise if re-saving the settings within Settings -> Permalinks does the trick?
It might be advisable to seek attention from the WPML staff on this issue.
Marking as invalid until further notice.
Closing this issue. When the bug comes back or persists, feel free to add comments and I'll reopen it.
Sorry for the late response.
I did test your solution before and now again - error still exists.
You can also see the bug at the mentioned compatibility page by wpml.
http://theseoframeworkplugin.compatibility.wpml.org/en/category/uncategorized/
I opened a ticked at wpml also, because I don't know which plugin caused the error.
https://wpml.org/forums/topic/false-canonical-link-on-category-archive-with-the-seo-framework-plugin/
Hi @michakrapp
The issue most likely resided within The SEO Framework.
Over the past 3 days, I've reworked how the URL generation works.
See https://github.com/sybrew/the-seo-framework/issues/201.
The gist is that we've offset all generation requirements towards WordPress. This is also where WPML resides and has configured all necessary changes.
With that undertaking, I could and have removed most compatibility required for translation plugins, like WPML.
So far, it's still in a development phase. But, I believe I've ironed most issues out.
I've tested WPML, and it works better than ever with TSF.
That said, I recommend waiting for the 3.0.0 release. But if you wish, at your own risk, you could try the current development version.
Note that the development version doesn't have up-to-date minified styles or scripts. So, some things might seem out of place in the dashboard.
Great News.
OK waiting for 3.0 then