Noindexing admin pages

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Noindexing admin pages

Post by Annie »

Script URL:
Version of script: 1.7
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: search engines, noindex, meta

Write your message below:

I notice that the search engines are indexing my View IP, Reply and Delete admin pages as well as my entries. Is there a way to add a noindex command for these particular admin items without losing the indexing of my actual guestbook comments.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Noindexing admin pages

Post by Klemen »

I wouldn't worry about that, but if you insist you could try modifying few files:

In templates/default/overall_header.php just below

Code: Select all

<head>
add

Code: Select all

<?php
if ( defined('NOINDEX') )
{
	echo '<meta name="robots" content="noindex, nofollow" />';
}
?>
Then in gbook.php find

Code: Select all

switch ($a)
and below that you will see several lines starting with case

Find pages you wish to hide from search engines (recognize them by "a=PAGENAME" in url after gbook.php, for example "a=delete") then add

Code: Select all

define('NOINDEX', true);
below the case line with the page name.

For example to hide the delete page, change

Code: Select all

        case 'delete':
        confirmDelete();
        break;
to

Code: Select all

        case 'delete':
		define('NOINDEX', true);
        confirmDelete();
        break;
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Re: Noindexing admin pages

Post by Annie »

Many thanks. I will give it a go.
Post Reply