Canonicals
-
Hi.
It seems that SEO Framework reports wrong (always the same, reports the Base page) canonicals for
https://www.ads-software.com/plugins/wpforo/
Is there a solution ? If not anyway to at least exclude canonical creation for specific pages ?
Thank you
-
Hi @massimod,
I just opened a support topic about this on wpforo’s support page:
https://www.ads-software.com/support/topic/detecting-wpforo-through-query/They’re very responsive, so we should be able to sort this out very soon ??
Cheers!
They are. They have a build-in meta generation for their plugin (that can be disabled), so maybe somekind of exclusion method could be implented.
In your plugin, could we have some manual way to enter urls to be excluded ? Is that hard to do ?
Thanks Sybre for the excellent plugin. I love it.
- This reply was modified 7 years, 8 months ago by massimod.
Since i guess it is impossible for your plugin to support all other plugins, please consider at least a way to exclude seo creation for certain urls.
Since wpForo is the second problem i encounter (the fist is Anspress) …. i guess there are several plugin incompatibilities.
Thanks
Yes the canonical URL is still a bit of an issue with some plugins.
This is mostly due to the fact that most plugins who make their complete front-end don’t supply everything required to
$wp_query
.
WooCommerce, for example, does work perfectly together with The SEO Framework (aside from the shop page). So does bbPress (aside from the tag archives).The exceptions (“aside from…”) have been treated with care, however.
I could simply insert the URL from the request URL, but that would completely defeat the purpose of eliminating duplicated content; and this will cause a lot of issue with many sites.
In TSF 2.8 I did implement a compatibility caller, so if any specifics are needed they can be inserted without extra load time.
Sybre, can i at least totally disable canonicals everywhere (until a solution is found) ?
Hi @massimod,
It’s rather silent there, isn’t it? ??
Nevertheless, this is what you’ll need to add to your theme’s
functions.php
file to completely disable the canonical URLs:add_filter( 'the_seo_framework_rel_canonical_output', '__return_empty_string' );
Cheers!
I;’m afraid Canonicals are not the only problem with wpForo.
Page titles are also not correct. I’m a bit lost on that to do.
@massimod, @veganostomy, @gvectors-team (wpForo authors),
I finally got to do some real digging with the plugin activated, and I got to a working solution.
The problem is that wpForo uses its own rewrite system, rather than WordPress’.
This is not a bad thing per se, because we are certain it will always work. In fact, it’s faster and in some ways much more compatible with other plugins.However, this does require an external compatibility layer for SEO plugins.
Without further ado, here’s a snippet you can add to your theme functions.php file which will fix the output:
/** * wpForo + The SEO Framework compatibility hook. */ add_action( 'init', function() { //* Only work on wp_foro page and when the_seo_framework is found. if ( function_exists( 'the_seo_framework' ) && function_exists( 'is_wpforo_page' ) && is_wpforo_page() ) { //* Fix titles. add_filter( 'the_seo_framework_pre_add_title', function( $title, $args, $escape ) { $wpforo_title = wpforo_meta_title( '' ); return $wpforo_title[0] ?: $title; }, 10, 3 ); //* Fix URLs. add_filter( 'the_seo_framework_url_path', function( $path, $id, $external ) { if ( $external ) return $path; return the_seo_framework()->set_url_scheme( wpforo_get_request_uri(), 'relative' ); }, 10, 3 ); /** * Remove duplicated description issues; * From TSF 2.9.2 the social descriptions will correctly too (API bugfix). */ add_filter( 'the_seo_framework_description_args', function( $defaults, $args ) { //* Disable internal requests only. Magic variable (i.e. do overthink it, as it will loop). if ( empty( $args['social'] ) && empty( $args['get_custom_field'] ) ) $defaults['get_custom_field'] = false; return $defaults; }, 10, 3 ); //* Remove wpforo SEO remove_action( 'wp_head', 'wpforo_add_meta_tags', 1 ); } }, -1 );
I hope this helps :).
If you require information regarding implementing the filter, please look here:
https://theseoframework.com/docs/using-filters/#whereCheers!
P.S. @gvectors-team:
The code provided above is a compatibility layer between your plugin and mine. I don’t expect this to fully reflect the outcome on your admin settings pages, but if you wish to work together on solving this; do let me know!@cybr This seems to work perfectly! Wow, I give you an A++ for effort!
I appreciate this effort so much that I’ll be ordering a subscription to your Extention Manager.
I’m hoping this fix becomes incorporated in either the WPForo plugin or The SEO Framework. Either way, I’m happy to see this working now!
Thank you so much @veganostomy ?? I appreciate that!
@Sybre, please in the next version of your plugin, include an option to EXCLUDE some page(s). Like other SEO plugins do.
Please. Trying to be compatible with all other plugins, isn’t gonna lead anywhere.
(i dont want to add anything to my functions.php files. Exclude whatever we want is the correct way to do this)
- This reply was modified 7 years, 7 months ago by massimod.
Hi @massimod,
I understand the wish for exclusion, but if we aren’t compatible with the other plugins… then there’s no way to exclude.
Simply put:
- First we need to know on which page we are (requires front-end compatibility layer).
- Then we need to know if you wish to exclude this page (requires back-end compatibility layer).
- Then we can exclude (this is OK).
If we can’t detect the query automatically (because no WP API is used), then we can’t cope with this through admin to front-end interaction.
If plugins do not adhere to WordPress’ API, then it’s an external problem. I can’t resolve this through automation.
The resolutions are difficult to choose from, and they are either of these (but nothing else):
- We create a snippet you add to your functions.php file (temporarily & single user).
- We create a snippet we add to the plugin itself (permanently).
- We fix a bug if present (which there isn’t).
- We block our plugin from working on the external plugin pages (permanently).
- The external plugin adds the snippet (permanently).
- The external plugin blocks our plugin from working on their pages (permanent).
- The external plugin fixes their bugs (accordance to WP API standards).
The best one is the WP API standards accordance, then the plugin will be automatically compatible.
Everything else is just a hack related to a single plugin that has an uncertain future.
That said, the next best thing is such a snippet I’ve created. It adds the least amount of load time for users that don’t use wpForo when included in the plugin.In conclusion, TSF is compatible with all other plugins, if only they’d adhere to WP API standards.
This is a goal many want to achieve… there just isn’t enough task-force power to enforce these rules.And at the end of the day, we are indeed wasting our time and going nowhere ??
This is ultimately and unfortunately proven by the fact that I was ignored on their support forums.@Sybre,
I don’t get why excluding a page or pages is hard to do. Your competition does it:
https://drive.google.com/open?id=0BwqfUUZEMQKFUTVWMC01S3U0RHc
Anyway, thanks for the replies.
@massimod Thanks for the picture!
That all does make this seem very feasible ??
I’ve opened a GitHub issue on this topic, so it’s planned as an extension:
https://github.com/sybrew/the-seo-framework/issues/112But that will take some time to complete. Luckily, 2.9.2 (due next week) will include the prior snippet.
Cheers!
Ok, i need either to fix this or to remove Seo Framework plugin. Right now SEO Framework semi-works, i mean the Description, og-title, are off.
Using the above php code in my theme functions didn’t solve that. I need a way to disable Seo Framework for wpForo, simple as that. And let wpForo do its seo thing.
I highly like Seo Framework but can’t have those problems anymore. I must move on.
thanks !
- The topic ‘Canonicals’ is closed to new replies.