Detect and Don't Redirect Search Bots

Detect and Don't Redirect Search Bots

If you are doing something like a client-side (front-end) redirect with Javascript you may want to still allow Google and other search bots to index the page's content so this snippet is a way to detect if the userAgency is a bot or not, and if they are don't redirect them.

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
2.28.23

Similar items

Items
2781
Search

Redirect Form on Submit and Pass Input Value to URL

10.23.22

Get Website Meta Data w/ Airtable Script

1.10.23

Get YouTube Thumbnails w/ Airtable Script

12.22.22

Get Image Size w/ Airtable Script

10.10.22

Set Referrer URL as Hidden Input

3.28.22

Restock

View Restock

Fetch and Nest Content From Another Page

3.17.22

Set Text From URL Parameters

2.19.22

Set Hidden Input Value From URL Parameters

8.25.21

Click Something Based on ID in URL

8.27.20

Get UTM Parameter Source From URL

3.28.22

Show a Preloader Only Once Per Day

1.3.24

Email Address Input Validation

12.15.23

Dark/Light Mode Favicon Images

9.12.23

Remove https:// From Text Link

9.5.23

Run Javascript on Mobile Only

7.26.23

Skip to Main Nav Link

6.14.23

Validate HTML Inputs w/ Pattern Attribute

5.4.23

Randomize Button Text on Click

1.12.23

Compress Images w/ Airtable Script

10.10.22

Simple Countdown to Date/Time

10.6.22

CSS Logo Marquee / Ticker

5.25.22

Birthday Age Gate Modal Overlay

5.10.22

View All or Show Less List Pagination

4.11.22

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.

Subscribe