Exclude a page from indexing on a per page basis I would like to be able to remove a page from search engines (external and drupal). I want to add a checkbox on the content type to be able to specify which page should or should not be indexed.

My plan is to check via the hook_node_save if the checkbox is checked, and if so, edit the robots.txt to add a Disallow via the provided url. If the box is unchecked, I remove it from the robots.txt 

This is complicated though. Does anyone has a better solution ?

Thanks,
I recommend installing the Metatag module. Once installed you will have a checkbox: Prevent search engines from indexing this page located on every node under Meta tags -> Advanced.