Add Google Search-box on your static website

hey guys,

today i integrate Google search box widget in my website which is very useful to add search functionality in our static website.

here is step for adding google widget in your website.

Go to Google Custom Search http://www.google.com/cse/

Click on Create a Custom Search Engine

Give it a name, enter sites you want to cover with the search.

Complete the process and get the javascript. Integrate the script into your static page.

Screenshot:

google search box

you can also customize this widget using different layout options. for example i want to display search result in new window tab. so i customized my code like

<gcse:searchbox-only newWindow=true></gcse:searchbox-only>

newWindow=true

visit Custom Search Element Control API for more information.

hope you like this post 🙂

Advertisements

Prevent your images from appearing in Google search results

google-security-lock-featured

Hello guys,

Sometime we need to prevent our images from appearing in Google result.   Please follow given steps to prevent your images.

To prevent images from your site appearing in Google’s image index, add a robots.txt file to the root of the server that blocks the image.

For example, if you want Google to exclude the dkprofile.jpg image that appears on your site at http://www.ursite.com/images/dkprofile.jpg, add the following to your robots.txt file:

User-agent: Googlebot-Image
Disallow: /images/dkprofile.jpg

The next time Google crawls your website, see this directive and drop your image from our search results

To remove all the images on your site from our index, place the following robots.txt file in your server root:

User-agent: Googlebot-Image
Disallow: /

Hope You all like dis..!!