• Resolved shiftisnow

    (@shiftisnow)


    I just switched from Yoast SEO to SEO Framework and I have the issue where every page on my Forums is titled ‘Forums’ in the browser instead of the title name of the specific topic page within the forums I open. I am unable to find a way to specifically block the SEO on the forums page so that all the correct titles show up. Is there a way for me to resolve this?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi Shift, it looks like you are running Asgaros Forum.

    I installed Asgaros Forum myself and unfortunately, Asharos Forum does not register any post types (Topics, forums, replies, etc.) and therefore TSF can’t be disabled in unhacky way on Asgaros forum.

    bbPress (another forum plugin for WordPress) registers their ost types properly, so they can be easily excluded like so.

    I opened an issue on Asharos GitHub for you. Now we need to wait for a responce and we can go from there. Until then, enjoy your weekend!

    Asgaros

    (@asgaros)

    Hello @lebaux @shiftisnow

    Custom Post Types are not an option for a forum-plugin because WordPress does not provide a “good API” in terms of performance which allows accessing data in a deep parent-child-structure using different post types (e.g. Select last post of topic A,B,C in sub-forum X in forum Y of category Z). This is the reason why Asgaros Forum uses its own database-tables and content-structure like other popular forum-plugins (wpForo for example).

    Usually SEO-plugins – like Yoast SEO – provides options to disable its meta-generation for certain pages or at least filters/hooks which allows site-owners/developers to control certain steps of your logic without directly modifying core-files of the plugin. I suggest you to add such a feature because a lot plugins already ensure that correct meta-tags are set inside the pages used by a certain plugin.

    Just another example: Assume I would use custom post-types for forum-topics and forum-posts. If you visit a forum-topic your plugin would now assume to show meta-tags based on the forum-topic post-type. However, this would not be the optimal way in a forum because for a topic the meta-output (e.g. descriptions) also depends on the content of the first forum-post inside of a forum-topic – which would be a completely different post-type. Thats why Asgaros Forum already takes care of SEO inside of forum-pages.

    • This reply was modified 6 years ago by Asgaros.
    • This reply was modified 6 years ago by Asgaros.
    Plugin Author Sybre Waaijer

    (@cybr)

    Hello ??

    I decided not to add wildcard exclusion functionality because it opens your site to negative SEO attacks, pronely caused by user error. I’ve done everything I can in The SEO Framework to stop and prevent these attacks, among preventing many other SEO mistakes. Yoast SEO doesn’t include this feature either, but mainly because other plugin authors add support for their plugin anyway.

    Although this mindset limits functionality, it ensures a stable, predictable, and secure environment. So users can simply activate the plugin and move on to their content without having to worry about SEO.

    With that said, I’m proposing this pragmatic route: a content-aware snippet! This snippet will disable The SEO Framework on Asgaros Forum’s pages:

    add_action( 'asgarosforum_prepare', function() {
       if ( function_exists( 'the_seo_framework' ) ) {
            remove_action( 'wp_head', [ the_seo_framework(), 'html_output' ], 1 );
       }
    } );

    You can place the snippet in your (child-)theme’s functions.php file or a custom (mu-)plugin. It is essentially what Asgaros Forum does for Yoast SEO out of the box.

    I hope this helps! Cheers ??

    Thread Starter shiftisnow

    (@shiftisnow)

    Does this mean that the fix must be done on the Asgaros end and not SEO framework? I like both plugins and don’t want to choose one over the other so I hope there is a way for a resolution; otherwise my forums and anyone else’s forums using Asgaros while using SEO framework will take a big hit on search engines.

    Hey Shift, the solution posted by Sybre above should work just fine — Asgaros Forums will manage SEO of forums on your website by itself, while TSF would take care of SEO everywhere else.

    Thread Starter shiftisnow

    (@shiftisnow)

    I placed that snippet at the end of my functions.php for my child theme but it doesn’t appear to have fixed any of the titles in the forums as they still say Forums for anything I click on. I purged the cache and still get this.

    Here is a screenshot: https://i.imgur.com/OS624Pa.jpg

    • This reply was modified 6 years ago by shiftisnow.
    Plugin Author Sybre Waaijer

    (@cybr)

    Hi again!

    My apologies, I only looked for the conflicts in the metadata. Below you find the updated snippet, which also reinstates Asgaros Forum’s ability to write the titles as intended.

    add_action( 'asgarosforum_prepare', function() {
    	global $asgarosforum;
    
    	if ( function_exists( 'the_seo_framework' ) ) {
    		$tsf = the_seo_framework();
    
    		// The SEO Framework tries to revoke the ability from other plugins that want to overwrite the title.
    		// It works flawlessly when the WordPress query is known. Alas, not so much when it's not.
    		// Here we give that access back to Asgaros Forum, after it's been revoked.
    		add_filter( 'wp_title', [ $asgarosforum, 'change_wp_title' ], 100, 3 );
    		add_filter( 'pre_get_document_title', [ $asgarosforum, 'change_pre_get_document_title' ], 100 );
    
    		// Remove duplicated title parts.
    		remove_filter( 'wp_title', [ $tsf, 'get_wp_title' ], 9, 3 );
    		remove_filter( 'pre_get_document_title', [ $tsf, 'get_document_title' ], 10 );
    
    		// Remove duplicated meta tags.
    		remove_action( 'wp_head', [ $tsf, 'html_output' ], 1 );
    	}
    } );
    Thread Starter shiftisnow

    (@shiftisnow)

    Thank you Sybre! That worked. I am glad I can use both of these great plugins together now.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable SEO Framework on a Specific Page?’ is closed to new replies.