• Resolved massimod

    (@massimod)


    Hello.

    It has been a long time i asked for a way to be able to exclude SEO from some pages and some plugin was promised at the time.

    I don’t mind the delay, but i seriously need to be able to MANUALLY add some code anywhere to be able to exclude some “base pages” (pages with a shortcode).

    I would be greatful is some code or filter or whatever could help me. I dont mind doing manual changes in the plugin or the theme code or anything needed.

    Thanks !

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @massimod,

    My apologies for the delay! It’s indeed been a year:
    https://github.com/sybrew/the-seo-framework/issues/112

    I had to focus on growth; which means I had to create features that appeal to everyone, rather than a few.

    Regardless, I really understand your need.

    I’ve created two hacks for you that will work.

    1. Disable TSF if shortcode is in content.
    2. Disable TSF if request starts with…

    The first I don’t recommend using; it’s more “solid” but it’s subject to inconsistency throughout updates. It’s also slower.

    The second I do recommend.

    1. https://gist.github.com/sybrew/a04ad70f42de81469c0d242f1b865e8e
    2. https://gist.github.com/sybrew/a3f8f37fc789eb920de83e61782fde26

    You can place either of the snippets in your theme’s “functions.php” file.

    For the first:
    What needs editing is the array of shortcodes you’ll want to exclude in get_tsf_excluded_shortcodes()

    For the second
    What needs editing is the array of pages you wish to exclude in $exclusions. It starts with the first slash after your domain name.

    Cheers ??

    Thread Starter massimod

    (@massimod)

    Sybre very kind and helpful as usual.

    Many thanks, works great.

    Thread Starter massimod

    (@massimod)

    Hello there.

    The above solution (2nd) stopped working after the latest update of your plugin.

    Thread Starter massimod

    (@massimod)

    wpForo has its own caching, its own seo, its own sitemap. Everything is done withing wpforo, that is how the devs decided. Good or Bad, that it their way to do it.

    There MUST be some way 2b excluded from your plugin easily. I think i will have to switch to something else, since this problem will remain for ever.

    • This reply was modified 6 years, 5 months ago by massimod.
    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @massimod,

    We’ve updated the wpForo compatibility, and we’ve updated the API of the plugin (read on…).

    However, the issue remains that wpForo isn’t integrated into WordPress via the Post Types API; instead, it’s a standalone piece of software that uses its own writing system and doesn’t communicate to the framework embedded with WordPress. This means no other plugin can reliably interface with it.

    Therefore, I doubt any SEO plugin will work nicely with wpForo. This is proven: they remove and block all features of the most popular SEO plugins within their code.

    So, switching to something else won’t help you ??

    I suggest contacting the wpForo support team to add extended support for The SEO Framework. Which is possible via their internal function wpforo_seo_clear().

    That said, here’s an updated version of the code above; which is based on their “disabling”-code for other SEO plugins. They’re free to use this snippet in their code.

    It will work with TSF v3.1 onward; we’ve improved how this is handled, so it’s much easier to integrate and maintain ??

    add_action( 'the_seo_framework_init', function() {
    	if ( ! function_exists( 'wpforo_feature' ) || ! function_exists( 'is_wpforo_page' ) )
    		return;
    
    	if ( ! wpforo_feature( 'seo-meta' ) )
    		return;
    
    	if ( is_wpforo_page() ) {
    		add_filter( 'the_seo_framework_overwrite_titles', '__return_false' );
    		add_action( 'the_seo_framework_after_init', function() {
    			remove_action( 'wp_head', [ the_seo_framework(), 'html_output' ], 1 );
    		} );
    	}
    }, 0 );

    I just tested this, and it works great! It should keep working for a very long time, too.

    Gist: https://gist.github.com/sybrew/f735501978042a94847503aade130fb4

    I hope this helps!

    Thread Starter massimod

    (@massimod)

    Sybre when i say “i switch to something else”, i mean some SEO plugin that permits easily to EXCLUDE everything you need to. Two top SEO plugin (top=number of installations as per www.remarpro.com) permits that.

    I do know that wpforo wants to be totally independant, i wrote that above. But most plugins (caching for example) permit to exclude whatever you want.

    _

    I will try your suggestion and update.

    Thread Starter massimod

    (@massimod)

    Sybre,

    Your code totally removes also wpForo build in SEO (meta etc etc).

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @massimod,

    That’s correct, I forgot that TSF disables wpForo’s SEO. My apologies for this oversight.

    A timeline
    It’s been 1.5 years since your last request on wpForo. Shortly thereafter, in TSF 2.9.2, I’ve added wpForo compatibility. This compatibility layer didn’t have an effect in combination with the snippet I’ve provided before (and where you opened this issue about).

    Do you need the snippets?
    So, TSF completely incorporates wpForo’s SEO into The SEO Framework. Have you tried removing all the code snippets I’ve provided, and see if it works out? I tested the compatibility thoroughly whilst writing it, and I’ve maintained it ever since. But if it doesn’t work for you, please tell me what else needs improving; so you won’t have to implement and maintain the snippets anymore.

    Updated the snippet
    In any case, I’ve updated the snippet (in the gist). That one reenables wpForo’s SEO, while disabling The SEO Framework’s compatibility layer and SEO output.

    Let me know if it works out ?? Cheers!

    Thread Starter massimod

    (@massimod)

    Sybre thanks for your time devoted to this topic, really thank you !

    I will test everything asap and update here.

    Thread Starter massimod

    (@massimod)

    Sybre see the following real example from on of my site. Two metas, one from wpForo and the same from your plugin.

    Some difference, mainly in the descriptions. Your description for example is always the very same.

    <!– wpForo SEO –>
    <link rel=”canonical” href=”https://www.discovervenice.eu/community/venice-travel/&#8221; />
    <meta name=”description” content=”Venice Forum, Travel Discussion for Venice in Italy. Questions & answers, photos and community” />
    <meta property=”og:title” content=”Venice Travel” />
    <meta property=”og:description” content=”Venice Forum, Travel Discussion for Venice in Italy. Questions & answers, photos and community” />
    <meta property=”og:url” content=”https://www.discovervenice.eu/community/venice-travel/&#8221; />
    <meta property=”og:site_name” content=”Discover Venice” />
    <meta name=”twitter:description” content=”Venice Forum, Travel Discussion for Venice in Italy. Questions & answers, photos and community”/>
    <meta name=”twitter:title” content=”Venice Travel” />
    <!– wpForo SEO End –>

    <!– Start The SEO Framework by Sybre Waaijer –>
    <meta name=”description” content=”City of Venice Travel Forum on Discover Venice…” />
    <meta property=”og:locale” content=”en_US” />
    <meta property=”og:type” content=”website” />
    <meta property=”og:title” content=”Venice Travel – Discover Venice” />
    <meta property=”og:url” content=”https://www.discovervenice.eu/community/venice-travel/&#8221; />
    <meta property=”og:site_name” content=”Discover Venice” />
    <link rel=”canonical” href=”https://www.discovervenice.eu/community/venice-travel/&#8221; />
    <script type=”application/ld+json”>{“@context”:”https://schema.org&#8221;,”@type”:”BreadcrumbList”,”itemListElement”:[{“@type”:”ListItem”,”position”:1,”item”:{“@id”:”https://www.discovervenice.eu/&#8221;,”name”:”Discover Venice”}},{“@type”:”ListItem”,”position”:2,”item”:{“@id”:”https://www.discovervenice.eu/community/venice-qa/what-tramezzini-means/?wpforo=signin&#8221;,”name”:”City of Venice Travel Forum”}}]}</script>
    <!– End The SEO Framework by Sybre Waaijer | 0.00393s –>

    ______________________________________________________________________________

    <!– wpForo SEO –>
    <link rel=”canonical” href=”https://www.discovervenice.eu/community/venice-travel/best-places-to-take-photos-in-venice/&#8221; />
    <meta name=”description” content=”Could you suggest the best spots to take pictures in and around Venice ? Thanks !” />
    <meta property=”og:title” content=”Best places to take photos in Venice?” />
    <meta property=”og:description” content=”Could you suggest the best spots to take pictures in and around Venice ? Thanks !” />
    <meta property=”og:url” content=”https://www.discovervenice.eu/community/venice-travel/best-places-to-take-photos-in-venice/&#8221; />
    <meta property=”og:site_name” content=”Discover Venice” />
    <meta name=”twitter:description” content=”Could you suggest the best spots to take pictures in and around Venice ? Thanks !”/>
    <meta name=”twitter:title” content=”Best places to take photos in Venice?” />
    <!– wpForo SEO End –>

    <!– Start The SEO Framework by Sybre Waaijer –>
    <meta name=”description” content=”City of Venice Travel Forum on Discover Venice…” />
    <meta property=”og:locale” content=”en_US” />
    <meta property=”og:type” content=”website” />
    <meta property=”og:title” content=”Best places to take photos in Venice? – Discover Venice” />
    <meta property=”og:url” content=”https://www.discovervenice.eu/community/venice-travel/best-places-to-take-photos-in-venice/&#8221; />
    <meta property=”og:site_name” content=”Discover Venice” />
    <link rel=”canonical” href=”https://www.discovervenice.eu/community/venice-travel/best-places-to-take-photos-in-venice/&#8221; />
    <script type=”application/ld+json”>{“@context”:”https://schema.org&#8221;,”@type”:”BreadcrumbList”,”itemListElement”:[{“@type”:”ListItem”,”position”:1,”item”:{“@id”:”https://www.discovervenice.eu/&#8221;,”name”:”Discover Venice”}},{“@type”:”ListItem”,”position”:2,”item”:{“@id”:”https://www.discovervenice.eu/community/venice-qa/what-tramezzini-means/?wpforo=signin&#8221;,”name”:”City of Venice Travel Forum”}}]}</script>
    <!– End The SEO Framework by Sybre Waaijer | 0.00350s –>

    • This reply was modified 6 years, 5 months ago by massimod.
    Thread Starter massimod

    (@massimod)

    This

    https://gist.github.com/sybrew/f735501978042a94847503aade130fb4

    also doesn’t work. Still blocking wpForo seo and shows yours !

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @massimod,

    The new snippet only works via a plugin or mu-plugin, my bad!
    You should change the_seo_framework_loaded to after_setup_theme for it to work in a theme file. I’ve updated the snippet accordingly.

    I also see that the descriptions are not on par. I’ll investigate this:
    https://github.com/sybrew/the-seo-framework/issues/360

    If you find any more issues without using the snippet, let me know!
    Keep an eye out for the upcoming changelogs, may you want to determine to abandon the snippet.

    Thread Starter massimod

    (@massimod)

    Hello Sybre,

    That latest commit seems to work just fine. I’m a bit ashamed for stealing your time, i must admit that.

    As for the descriptions, yes, they seem uncorrect. That is why i posted that, for you to compare.

    Thank a lot and all the best.

    • This reply was modified 6 years, 5 months ago by massimod.
    Thread Starter massimod

    (@massimod)

    Sybre actually i think your descriptions in some cases are off, not only in wpForo.

    In WP Blog categories for example:

    <!-- Start The SEO Framework by Sybre Waaijer -->
    <meta name="description" content="Category:" />
    <meta property="og:locale" content="en_US" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Category: Puerto Rico | Travel-World.eu" />
    <meta property="og:url" content="https://www.travel-world.eu/category/caribbean/puerto-rico/" />
    <meta property="og:site_name" content="Travel-World.eu" />
    <link rel="canonical" href="https://www.travel-world.eu/category/caribbean/puerto-rico/" />
    <!-- End The SEO Framework by Sybre Waaijer | 0.00210s -->
    Plugin Author Sybre Waaijer

    (@cybr)

    @massimod confirmed! Thanks for that ?? I’ll have it fixed in the next patch by omitting additions that are below the lower threshold (42 characters) when no excerpt can be generated.

    Note that we now recommend turning off the additions; this would mean you’ll get an empty description. In either case, Google would treat the category the same regardless: a description that’s too short will be ignored.

    • This reply was modified 6 years, 5 months ago by Sybre Waaijer. Reason: clarity
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘REALLY REALLY Need to exclude SEO for some pages’ is closed to new replies.