pyoil (@pyoil)

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

  • pyoil
    Participant

    @pyoil

    If you are using SEO Yoast Plugin you can do the following to your functions.php to update the robots meta tags.

    
    function noindex_profile($html) {
      	if (bbp_is_single_user()){
    	  	$html = "noindex,nofollow";
    	} 
    	  return $html;
    }
    add_action( 'wpseo_robots', 'noindex_profile' ); 
    

    If you are not using any plugin or don’t see any robot tags to update in your userprofile, use the below instead and the insertion will be made in the head

    
    function noindex_profile() {
      	if (bbp_is_single_user()){
      	  	echo '<META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW” />' ;
      	}
    }
    add_action( 'wp_head', 'noindex_profile' );
    

    Hope this helps.


    pyoil
    Participant

    @pyoil

    It works. Thanks a lot @robin-w

    Any chance we can add this to the beginning of the header of the user profile page?

    Right now it is rendered inside the body tag.


    pyoil
    Participant

    @pyoil

    Thanks for the quick reply and detailed steps @robin-w. Really helpful.

    Wondering if the Meta can be added through PHP instead of using a child theme?

    I use the Snippet plugin to add and keep track of code, so I don’t lose track of these customizations (and potential conflicts) in the future. So a PHP hook will be really useful.


    pyoil
    Participant

    @pyoil

    Small change to the exclusion list. Excluding the backbone.min.js and js/underscore.min.js broke the forum page.

    Add the following instead:
    js/tinymce, js/comment-reply.min.js


    pyoil
    Participant

    @pyoil

    Disable your plugins one by one, starting with your cache plugins and see if it fixes the issue.

    I was having the same issue. In my case, my cache plugin was breaking both the tinymce visual editor and the quick tags in the text editor.

    To fix both, I excluded the following JS scripts in my cache plugins:

    js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js

    If you use Autooptimize then add the above piece of code here

    Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:


    pyoil
    Participant

    @pyoil

    Disable your plugins one by one, starting with your cache plugins and see if it fixes the issue.

    I was having the same issue. In my case, my cache plugin Autooptimize was breaking both the tinymce visual editor and the quick tags in the text editor.

    To fix both, I excluded the following JS scripts in my cache plugins:

    js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js

    If you use Autooptimize then add the above piece of code here

    Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:


    pyoil
    Participant

    @pyoil

    Disable your plugins one by one, starting with your cache plugins and see if it fixes the issue.

    I was having the same issue. In my case, my cache plugin was breaking both the tinymce visual editor and the quick tags in the text editor.

    To fix both, I excluded the following JS scripts in my cache plugins:

    js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js

    If you use Autooptimize then add the above piece of code here

    Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:


    pyoil
    Participant

    @pyoil

    In my case autooptimize was breaking both the tinymce visual editor and the tags in the text editor.

    To fix both, exclude the following scripts from your cache plugins:

    js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js

    If you use Autooptimize then add the above piece of code here

    Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:

Viewing 8 replies - 1 through 8 (of 8 total)