Adding Google Search to 404 error page

IN Marketing & Wordpress

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:

page not found


Penny (
Penny (

Who are we? What are we doing here? What is the meaning of life? Penny is a truth-seeker, ever-questioning, ever-learning, ever-researching, ever delving further and deeper down the rabbit hole. This site is a legacy of sorts, a place to collect thoughts, notes, book summaries, whilst providing a searchable archive to easily lookup and reference.