• Resolved titsmaker

    (@titsmaker)


    Hi. I use your plugin’s feature to add sitemap to robots.txt and recently I noticed that robots.txt lacks some code that is supposed to be added by Blackhole for Bad Bots plugin. As soon as I deactivate SEO Framework blackhole rule is in the file.
    I contacted their support and was told that they implement the feature properly, so I have to ask you to check if everything is fine on your side.
    Here’s related support topic – https://ww.wp.xz.cn/support/topic/does-not-add-robots-txt-rules/#post-14097459

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

    (@cybr)

    Hello!

    If you want to ensure adding anything to a filter, then you must use a higher priority. I think this slipped Jeff’s mind because TSF does not interfere with that.

    This snippet will do — it basically makes the default 10-priority an 11. The init-action-wrapper is there to mitigate plugin-race-conditions, and the function-exists wrapper is there to prevent a PHP error when the Blackhole plugin is deactivated.

    add_action( 'init', function() {
    	if ( function_exists( 'blackhole_robots_wordpress' ) )
    		add_filter( 'robots_txt', 'blackhole_robots_wordpress', 11, 2 );
    } );
    

    I explained the reasoning behind overwriting the robots.txt output here… mind it’s difficult to read: https://github.com/sybrew/the-seo-framework/issues/339#issuecomment-546684189.

    Thread Starter titsmaker

    (@titsmaker)

    Thank you for quick reply and fix. So this is deliberate behaviour by your plugin, I got your reasoning.

    In the next version of Blackhole for Bad Bots, the priority on adding robots rules is increased to 11, should help with the above described issue. New version of Blackhole should be available later today. Thanks @titsmaker and @cybr for your input and help.

    • This reply was modified 4 years, 10 months ago by Jeff Starr.
    Plugin Author Sybre Waaijer

    (@cybr)

    Thank you, Jeff (@specialk), for your contributions!

    I know I’ve been a bit harsh to you in the past, and I apologize. I hope you have a peaceful WP 5.8 launch event 🙂 Cheers!

    It’s all good, @cybr. I appreciate the kind words 🙂

    Cheers!

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

The topic ‘Plugin interferes with other plugins modifying robots.txt’ is closed to new replies.