Adding Google Search to 404 error page
Google has a javascript file that you can add to your 404 page so that your visitors can easily search your entire site for whatever they were expecting.
Click here to get your customized code in your language.
For me, it’s English (UK) so I use the following code:
[snippet id=”335″]
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: