Bots using internal wordpress search

I suggest using a security plugin which will do everything for you.
Like iThemes Security

Bans troublesome user agents, bots and other hosts

https://wordpress.org/plugins/better-wp-security/