Prevent a Page from Being Indexed by Search Engines

Permalink
Hello,

How do I prevent a page from being Indexed by a search engine?

I heard something about robots.txt, but I don't know in what folder my webpages are stored. I ftp to my site and I searched in the "public_html" folder. Except for index.php, I couldn't find any other pages.

Thanks.

 
12345j replied on at Permalink Reply
12345j
there are two easy ways to do this.
1. ftp to the root directory where c5 is. there should be a file there called robots.txt open that up and add
Disallow: /
to the end of it. then save it.
2. Alternatively you could open up default.php for your theme (located in the themes folder or the packages folder) and go to elements/header.php and between the <head> and </head>
use this
<meta name="robots" content="noindex,nofollow" /> <!-- CHANGE BEFORE GOING LIVE -->
and that should work too. for more info go here.
http://www.concrete5.org/community/forums/chat/hide-site-from-being...
minotlee replied on at Permalink Reply
Thank you. But that seems to hide the entire website. I just want to hide a certain page.
12345j replied on at Permalink Reply
12345j
okay. so this is a bit more complicated. duplicate your default.php file(or whatever page you want the hidden page to be) to and rename it hide.php or something like that. then inspect your theme, and for all the pages that you want hidden use the page type hide. next, copy all the contents your header.php file and put it at the top of hide.php instead of
<?php 
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>

then use
<meta name="robots" content="noindex,nofollow" /> <!-- CHANGE BEFORE GOING LIVE -->
between the head tags in hide.php. save it and you should be good to go!
minotlee replied on at Permalink Reply
Thanks. I don't fully understand. Should I put hide.php in the same folder as default.php (at /public_html/concrete/themes/default/)? Also, on my website I first clicked "Edit Page" and then clicked "Design". There are only four page types: Full Width, Left Sidebar, Press Release, and Right Sidebar. I didn't see "hide".
12345j replied on at Permalink Reply
12345j
yes, you should put it in the same folder. then you want to go to the themes page in the dashboard and then you want to click on the inspect button next to plain yogurt and hide should be a new page type to activate. ( by the way you probably want to copy it to root/themes to keep your edits.)
minotlee replied on at Permalink Reply
Understood. Thank you.