Notifications
Clear all

wpForo 1.x.x [Solved] Wpforo with rankmath

3 Posts
2 Users
0 Reactions
1,830 Views
Posts: 2
Topic starter
(@osmantarar)
New Member
Joined: 4 years ago

i have sent this message to rank math team:

before installing rankmath my forums from wpforo show at the top browser tab “forum name and forum page name” but after rank math intallation it only shows forums | website name.

before:
https://drive.google.com/open?id=1fhTpwMYmG2e1BiJorXgRTp7UkB_a8WsI
after:
https://drive.google.com/open?id=1aTWYBbrEV9O_aAHydrFXJrkTDku0ewLs

there ans was:

Please add the following code in your theme’s functions.php file:

add_action( 'wp_head', function() {
    if ( IS_WP_FORO_PAGE ) {
	    remove_all_filters( 'pre_get_document_title', 15 );
    }
}, 1 );

You will have to change the condition to run this on wpForo pages only.

Also, you can also forward this to the wpForo team so they can add it to their plugin.

 

what do i need to do now?

2 Replies
Robert
Posts: 10583
Admin
(@robert)
Support Team
Joined: 8 years ago

Last year we've added this code in wpForo to disable it on wpForo pages:

if ( defined('RANK_MATH_FILE') ) { // Rank Math SEO
remove_all_actions( 'rank_math/head' );
add_filter( 'rank_math/frontend/remove_credit_notice', '__return_true' );
}

So there should not be such problem. Maybe they have changed their hooks, so please contact them and refer them to this topic.

 

But you can ty their code with the small change. Here is the final code. You should put it in the active WordPress theme functions.php file:

add_action( 'wp_head', function() {
if( function_exists('is_wpforo_page') && is_wpforo_page() ){
remove_all_filters( 'pre_get_document_title', 15 );
}
}, 1 );

How to Easily Add Custom Code in WordPress (without Breaking Your Site)

Posts: 2
Topic starter
(@osmantarar)
New Member
Joined: 4 years ago

thanks it works...