<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Townes &#187; 不统计</title>
	<atom:link href="https://thetownes.coolpage.biz/?feed=rss2&#038;tag=%E4%B8%8D%E7%BB%9F%E8%AE%A1" rel="self" type="application/rss+xml" />
	<link>https://thetownes.coolpage.biz</link>
	<description>本站已转移至：http://www.thetownes.info</description>
	<lastBuildDate>Thu, 01 Aug 2013 11:49:56 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2</generator>
		<item>
		<title>让统计代码不统计自己</title>
		<link>https://thetownes.coolpage.biz/?p=253</link>
		<comments>https://thetownes.coolpage.biz/?p=253#comments</comments>
		<pubDate>Sat, 13 Jul 2013 01:50:02 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[日常技术]]></category>
		<category><![CDATA[不统计]]></category>
		<category><![CDATA[统计代码]]></category>

		<guid isPermaLink="false">http://thetownes.coolpage.biz/?p=253</guid>
		<description><![CDATA[很多新站长站点建立完毕后就开始简单地推广后，就插件51百度cnzz的统计代码，看 &#8230; <a href="https://thetownes.coolpage.biz/?p=253">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>很多新站长站点建立完毕后就开始简单地推广后，就插件51百度cnzz的统计代码，看到PV何其的高。页面访问却只有哪么几个，来路寥寥无几，百度谷歌可能一个IP都没有，纵是有也可能是自己site后点击的结果。统计的结果很显然有很大部份是自己的因素，频繁的更新，频繁的刷新……OK！有没有什么办法可以让统计代码不统计自己呢以下是来自<a href="http://www.ludou.org/">露兜博客</a>里的内容非常不错的说。</p>
<p>1、WordPress博客如何不统计登陆用户？<br />
现在很多博客都使用WordPress来搭建，这其中又有很多博客都是单用户博客，只有一个博主，这样不统计已登陆用户的访问数据即可不统计博主的访问数据。一般我们都将统计代码放在footer.php中，那现在用文本编辑器打开你的footer.php，找到你的统计代码，将其改成</p>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1<br />
2<br />
3</div>
</td>
<td>
<div>&lt;?php global $user_ID; if (!$user_ID) : ?&gt;<br />
这里替换成统计代码<br />
&lt;?php endif; ?&gt;</div>
</td>
</tr>
</tbody>
</table>
<p>这样在没有任何用户登录的情况下，才在你的博客页面输出统计代码，否则不输出统计代码，博主在已登陆的情况，就跟没安装统计代码一样，你可以“查看页面源代码”试试。</p>
<p>2、WordPress博客如何不统计特定用户？<br />
在WordPress博客系统中，已为每位用户分配一个用户ID，如果不想统计ID为5的用户访问信息，可以将统计代码改成：</p>
<div>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1<br />
2<br />
3</div>
</td>
<td>
<div>&lt;?php global $user_ID; if ( 5 != $user_ID) : ?&gt;<br />
这里替换成统计代码<br />
&lt;?php endif; ?&gt;</div>
</td>
</tr>
</tbody>
</table>
</div>
<p><em>WordPress后台 – 用户，这里每个用户名都是类似以下的超链接:</em></p>
<p>http://example.com/wp-admin/user-edit.php?user_id=5&#038;wp_http_referer=%2Fwp-admin%2Fusers.php</p>
<p><em>那么该用户的ID就是5</em><br />
3、如何不统计特定IP的用户？<br />
如果你使用的是固定IP或者固定的IP段，那这个问题就更好办了，不统计你指定的IP或IP段即可。</p>
<div>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7</div>
</td>
<td>
<div>&lt;?php<br />
$iipp = ‘ ‘ . $_SERVER["REMOTE_ADDR"];<br />
// 将以下 192.168.2.1 改成你的IP或IP地址段<br />
if ( strpos($iipp,’192.168.2.1′) === false ) :<br />
?&gt;<br />
这里替换成统计代码<br />
&lt;?php endif; ?&gt;</div>
</td>
</tr>
</tbody>
</table>
</div>
<p>如果你排除多个IP或IP地址段，可以改成：</p>
<div>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>&nbsp;</td>
<td>
<div>&lt;?php<br />
$iipp = ‘ ‘ . $_SERVER["REMOTE_ADDR"];<br />
// 同理你可以增加排除IP的个数<br />
if ( strpos($iipp,’192.168.2.1′) === false<br />
|| strpos($iipp,’192.168.2.2′) === false) :<br />
?&gt;<br />
这里替换成统计代码<br />
&lt;?php endif; ?&gt;</div>
</td>
</tr>
</tbody>
</table>
</div>
<p>注:如果你的站点完全静态化，上面的代码无效。请注意。</p>
]]></content:encoded>
			<wfw:commentRss>https://thetownes.coolpage.biz/?feed=rss2&#038;p=253</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
