Advertisement:

Author Topic: What Is Wap2  (Read 11304 times)

Offline humbleworld

  • Sr. Member
  • ****
  • Posts: 841
    • full time job
What Is Wap2
« 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?

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 23,890
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: What Is Wap2
« Reply #1 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
Code: [Select]
// 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
Code: [Select]
// 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>';
}

Offline humbleworld

  • Sr. Member
  • ****
  • Posts: 841
    • full time job
Re: What Is Wap2
« Reply #2 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.

Offline JimM

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,977
  • Gender: Male
    • Southern Spirit Hunters
Re: What Is Wap2
« Reply #3 on: January 17, 2009, 10:10:53 PM »
Marking  this one as solved.
Jim "JimM" Moore
Former Support Specialist
jimm@simplemachines.org

Please do not PM me for support!                   
Installing SMF
Upgrade SMF
Manual Installation of Mods