Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: humbleworld on October 22, 2008, 07:19:17 AM

Title: What Is Wap2
Post by: humbleworld on October 22, 2008, 07:19:17 AM
Several pages of our forum site are indexed by Google with this kind of URL:

http://forumname.com/index.php?topic=15865.0;wap2

Now this wap2 contains nothing but individual thread of the forum. The forum itself does not show up.

What is Wap2?
How can I stop Google from indexing Wap2?
Title: Re: What Is Wap2
Post by: Oldiesmann on October 22, 2008, 11:45:02 AM
WAP2 is a wireless-friendly display mode. See http://en.wikipedia.org/wiki/WAP2 for more info.

Google somehow found a link to a wap2 page on your forum and because it's all text (rather than text mixed with images), Google likes it more than the regular version.

To prevent Google from indexing wap2 pages...

Themes/default/Wireless.template.php

Find
// XHTMLMP (XHTML Mobile Profile) templates used for WAP 2.0 start here
function template_wap2_above()
{
global $context, $settings, $options;

echo '<?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" href="', $settings['default_theme_url'], '/wireless.css" type="text/css" />
</head>
<body>';
}


Replace
// XHTMLMP (XHTML Mobile Profile) templates used for WAP 2.0 start here
function template_wap2_above()
{
global $context, $settings, $options;

echo '<?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" href="', $settings['default_theme_url'], '/wireless.css" type="text/css" />
<meta name="robots" content="noindex" />
</head>
<body>';
}
Title: Re: What Is Wap2
Post by: humbleworld on January 11, 2009, 09:12:40 AM
Thanks Oldiesmann for the helpful code. Robots.txt was able to block Googlebot from indexing WAP2 in my site. But before that, there were some 30,000 pages of my SMF site that belong to WAP2 indexing.
Title: Re: What Is Wap2
Post by: JimM on January 17, 2009, 10:10:53 PM
Marking  this one as solved.