Adding Google Search to 404 error page
Click here to get your customized code in your language.
For me, it’s English (UK) so I use the following code:
In WordPress, you just go to Appearance > Editor
Then click on the 404 template and paste the text wherever you want the searchbox to appear.
And it looks like this: