Title: WP-PostViews
Author: Lester Chan
Published: <strong>2006年2月8日</strong>
Last modified: 2025年8月31日

---

プラグインを検索

![](https://ps.w.org/wp-postviews/assets/banner-772x250.jpg?rev=1206762)

![](https://ps.w.org/wp-postviews/assets/icon.svg?rev=978002)

# WP-PostViews

 作者: [Lester Chan](https://profiles.wordpress.org/gamerz/)

[ダウンロード](https://downloads.wordpress.org/plugin/wp-postviews.1.78.zip)

 * [詳細](https://ja.wordpress.org/plugins/wp-postviews/#description)
 * [レビュー](https://ja.wordpress.org/plugins/wp-postviews/#reviews)
 * [開発](https://ja.wordpress.org/plugins/wp-postviews/#developers)

 [サポート](https://wordpress.org/support/plugin/wp-postviews/)

## 説明

### 使い方

 1. Open `wp-content/themes/<YOUR THEME NAME>/index.php`
 2. You may place it in archive.php, single.php, post.php or page.php also.
 3. Find: `<?php while (have_posts()) : the_post(); ?>`
 4. Add Anywhere Below It (The Place You Want The Views To Show): `<?php if(function_exists('
    the_views')) { the_views(); } ?>`
 5. Or you can use the shortcode `[views]` or `[views id="1"]` (where 1 is the post
    ID) in a post
 6. Go to `WP-Admin -> Settings -> PostViews` to configure the plugin.

### 開発

[https://github.com/lesterchan/wp-postviews/](https://github.com/lesterchan/wp-postviews/)

### 翻訳

[http://dev.wp-plugins.org/browser/wp-postviews/i18n/](http://dev.wp-plugins.org/browser/wp-postviews/i18n/)

### クレジット

 * Plugin icon by [Iconmoon](http://www.icomoon.io) from [Flaticon](http://www.flaticon.com)

### 寄付

I spent most of my free time creating, updating, maintaining and supporting these
plugins, if you really love my plugins and could spare me a couple of bucks, I will
really appreciate it. If not feel free to use it without any obligations.

### Version 1.76.1

 * NEW: Add Post Author in views template
 * NEW: Bump for WordPress 5.3

### Version 1.76

 * NEW: Added postviews_should_count filter
 * FIXED: Change to (int) from intval() and use sanitize_key() with it.

### Version 1.75

 * NEW: Use WP_Query() for most/least viewed posts

### Version 1.74

 * NEW: Bump WordPress 4.7
 * NEW: Template variable %POST_CATEGORY_ID%. It returns Post’s Category ID. If 
   you are using Yoast SEO Plugin, it will return the priority Category ID. Props
   @FunFrog-BY

### Version 1.73

 * FIXED: In preview mode, don’t count views

### Version 1.72

 * NEW: Add %POST_THUMBNAIL% to template variables

### Version 1.71

 * FIXED: Notices in Widget Constructor for WordPress 4.3

### Version 1.70

 * FIXED: Integration with WP-Stats

### Version 1.69

 * NEW: Shortcode `[views]` or [views id=”POST_ID”]` to embed view count into post
 * NEW: Added template variable `%VIEW_COUNT_ROUNDED%` to support rounded view count
   like 10.1k or 11.2M

### Version 1.68

 * NEW: Added action hook ‘postviews_increment_views’ and ‘postviews_increment_views_ajax’
 * NEW: Allow custom post type to be chosen under the widget

### Version 1.67

 * NEW: Allow user to not use AJAX to update the views even though WP_CACHE is true

### Version 1.66

 * NEW: Supports MultiSite Network Activation
 * NEW: Add %POST_DATE% and %POST_TIME% to template variables
 * NEW: Add China isearch engines bots
 * NEW: Ability to pass in an array of post types for get_most/least_*() functions.
   Props Leo Plaw.
 * FIXED: Moved uninstall to uninstall.php and hence fix missing nonce. Props Julio
   Potier.
 * FIXED: Notices and better way to get views from meta. Props daankortenbach.
 * FIXED: No longer needing add_post_meta() if update_post_meta() fails.

### Version 1.65 (02-06-2013)

 * FIXED: Views not showing in WP-Admin if “Display Options” is not set to “Display
   to everyone”

## スクリーンショット

 * [[
 * PostViews
 * [[
 * Admin – PostViews Options

## FAQ

### How To View Stats With Widgets?

 * Go to `WP-Admin -> Appearance -> Widgets`
 * The widget name is Views.

### To Display Least Viewed Posts

    ```
    <?php if (function_exists('get_least_viewed')): ?>
        <ul>
            <?php get_least_viewed(); ?>
        </ul>
    <?php endif; ?>
    ```

 * The first value you pass in is the post type that you want. If you want to get
   every post types, just use ‘both’. It also supports PHP array: example `array('
   post', 'page')`.
 * The second value you pass in is the maximum number of post you want to get.
 * Default: get_least_viewed(‘both’, 10);

### To Display Most Viewed Posts

    ```
    <?php if (function_exists('get_most_viewed')): ?>
        <ul>
            <?php get_most_viewed(); ?>
        </ul>
    <?php endif; ?>
    ```

 * The first value you pass in is the post type that you want. If you want to get
   every post types, just use ‘both’. It also supports PHP array: example `array('
   post', 'page')`.
 * The second value you pass in is the maximum number of post you want to get.
 * Default: get_most_viewed(‘both’, 10);

### To Display Least Viewed Posts By Tag

    ```
    <?php if (function_exists('get_least_viewed_tag')): ?>
        <ul>
            <?php get_least_viewed_tag(); ?>
        </ul>
    <?php endif; ?>
    ```

 * The first value you pass in is the tag id.
 * The second value you pass in is the post type that you want. If you want to get
   every post types, just use ‘both’. It also supports PHP array: example `array('
   post', 'page')`.
 * The third value you pass in is the maximum number of post you want to get.
 * Default: get_least_viewed_tag(1, ‘both’, 10);

### To Display Most Viewed Posts By Tag

    ```
    <?php if (function_exists('get_most_viewed_tag')): ?>
        <ul>
            <?php get_most_viewed_tag(); ?>
        </ul>
    <?php endif; ?>
    ```

 * The first value you pass in is the tag id.
 * The second value you pass in is the post type that you want. If you want to get
   every post types, just use ‘both’. It also supports PHP array: example `array('
   post', 'page')`.
 * The third value you pass in is the maximum number of post you want to get.
 * Default: get_most_viewed_tag(1, ‘both’, 10);

### To Display Least Viewed Posts For A Category

    ```
    <?php if (function_exists('get_least_viewed_category')): ?>
        <ul>
            <?php get_least_viewed_category(); ?>
        </ul>
    <?php endif; ?>
    ```

 * The first value you pass in is the category id.
 * The second value you pass in is the post type that you want. If you want to get
   every post types, just use ‘both’. It also supports PHP array: example `array('
   post', 'page')`.
 * The third value you pass in is the maximum number of post you want to get.
 * Default: get_least_viewed_category(1, ‘both’, 10);

### To Display Most Viewed Posts For A Category

    ```
    <?php if (function_exists('get_most_viewed_category')): ?>
        <ul>
            <?php get_most_viewed_category(); ?>
        </ul>
    <?php endif; ?>
    ```

 * The first value you pass in is the category id.
 * The second value you pass in is the post type that you want. If you want to get
   every post types, just use ‘both’. It also supports PHP array: example `array('
   post', 'page')`.
 * The third value you pass in is the maximum number of post you want to get.
 * Default: get_most_viewed_category(1, ‘both’, 10);

### To Sort Most/Least Viewed Posts

 * You can use: `<?php query_posts( array( 'meta_key' => 'views', 'orderby' => '
   meta_value_num', 'order' => 'DESC' ) ); ?>`
 * Or pass in the variables to the URL: `http://yoursite.com/?v_sortby=views&v_orderby
   =desc`
 * You can replace DESC with ASC if you want the least viewed posts.

### To Display Updating View Count With LiteSpeed Cache

Use: `<div id="postviews_lscwp"></div>` to replace `<?php if(function_exists('the_views')){
the_views(); } ?>`.
 NOTE: The id can be changed, but the div id and the ajax function
must match. Replace the ajax query in `wp-content/plugins/wp-postviews/postviews-
cache.js` with

    ```
    jQuery.ajax({
        type:"GET",
        url:viewsCacheL10n.admin_ajax_url,
        data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",
        cache:!1,
        success:function(data) {
            if(data) {
                jQuery('#postviews_lscwp').html(data+' views');
            }
       }
    });
    ```

Purge the cache to use the updated pages.

### To Get Views With REST API

You can obtain the number of post views by adding `views` to your `_fields` parameter:
/
wp/v2/posts?_fields=views,title

## 評価

![](https://secure.gravatar.com/avatar/a6bd2ffefeab19f6b63b4bf213036879c37c226bc6dc43b32bd1aefd63fa3cf1?
s=60&d=retro&r=g)

### 󠀁[Useful plugin, but unique view counting by IP would be a great addition](https://wordpress.org/support/topic/useful-plugin-but-unique-view-counting-by-ip-would-be-a-great-addition/)󠁿

 [KR. Laboratories](https://profiles.wordpress.org/krashlab/) 2025年10月21日

I’ve been using WP-PostViews for some time now, and it’s a very straightforward 
and effective plugin for displaying post views. The settings to count views only
from guests and exclude bots work well. However, I’ve noticed that if a guest refreshes
a page multiple times, each refresh is counted as a new view. While this is typical
behavior for a basic hit counter, it makes the view count less representative of
actual unique visitors. I would highly recommend considering an enhancement to include
an option to count unique views based on IP address (e.g., once per IP within a 
specified timeframe like 24 hours). This would significantly improve the accuracy
of the statistics and make the plugin even more valuable for site owners who want
to track genuine reader engagement. Thank you for this plugin!

![](https://secure.gravatar.com/avatar/eb107a34064b50d8474267f0f6868340edb106916e0836fa110e0d9b82f13e62?
s=60&d=retro&r=g)

### 󠀁[No longer works with Advanced Queries / Elementor](https://wordpress.org/support/topic/no-longer-works-with-advanced-queries-elementor/)󠁿

 [whitelabelcroydon](https://profiles.wordpress.org/whitelabelcroydon/) 2024年4月
26日

Have been using this a while along side Advanced Queries and Elementors Loop widget
to display a list grid of most popular articles on a website. Doesnt seem to be 
working anymore. I think its still keeping count of the post views, but the views
template variable isnt pulling in the correct posts. From the posts it is showing
it looked like it stopped updating in January of this year. Will need to find another
solution!

![](https://secure.gravatar.com/avatar/d366ac4ddbadeab9be721eaf762279e0e5d3f19b1d60f5424926013d59437780?
s=60&d=retro&r=g)

### 󠀁[It doesn’t work with 6.5.2 wordpres version](https://wordpress.org/support/topic/it-doesnt-work-with-6-5-2-wordpres-version/)󠁿

 [sergio.pinna.prato](https://profiles.wordpress.org/sergiopinnaprato/) 2024年4月
21日

It doesn’t work with 6.5.2 wordpres version.

![](https://secure.gravatar.com/avatar/e5f7b48fc5828047a785177445d5c23bd60340bd984b3cf46010f3bb441b3612?
s=60&d=retro&r=g)

### 󠀁[I guess this is no longer in supported](https://wordpress.org/support/topic/i-guess-this-is-no-longer-in-supported/)󠁿

 [Beulahland83](https://profiles.wordpress.org/beulahland83/) 2023年1月8日

The plugin is no longer compatible with some themes example of (Corpo)

![](https://secure.gravatar.com/avatar/c017a834db5513b02da7e23515932225d4ff9d4441cd99291e92beff20e01058?
s=60&d=retro&r=g)

### 󠀁[very useful](https://wordpress.org/support/topic/very-useful-2967/)󠁿

 [douggeeks](https://profiles.wordpress.org/douggeeks/) 2022年3月23日

Very useful little plugin.

![](https://secure.gravatar.com/avatar/277e3a55b0061c5b136b04acb20de33371ab3a0b23024de671d12570ddce961e?
s=60&d=retro&r=g)

### 󠀁[Awesome](https://wordpress.org/support/topic/awesome-9173/)󠁿

 [Ahmed Faruk](https://profiles.wordpress.org/ahmedfaruk/) 2021年12月6日

This is the Plugin that I was looking for. Thanks a lot!

 [ 65件のレビューをすべて表示 ](https://wordpress.org/support/plugin/wp-postviews/reviews/)

## 貢献者と開発者

WP-PostViews はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献し
ています。

貢献者

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)

“WP-PostViews” は18ロケールに翻訳されています。 [翻訳者](https://translate.wordpress.org/projects/wp-plugins/wp-postviews/contributors)
のみなさん、翻訳へのご協力ありがとうございます。

[“WP-PostViews” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/wp-postviews)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/wp-postviews/)するか、
[SVN リポジトリ](https://plugins.svn.wordpress.org/wp-postviews/)をチェックするか、
[開発ログ](https://plugins.trac.wordpress.org/log/wp-postviews/)を [RSS](https://plugins.trac.wordpress.org/log/wp-postviews/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

### Version 1.78

 * NEW: Add %POST_THUMBNAIL_URL% to template variables

### Version 1.77

 * NEW: Use Vanilla JS. Props @JiveDig
 * NEW: Bump to WordPress 6.2
 * NEW: Support views under fields for Rest API. Props @vitro-mod

## メタ

 *  バージョン **1.78**
 *  最終更新日 **9か月前**
 *  有効インストール数 **100,000+**
 *  WordPress バージョン ** 4.0またはそれ以降 **
 *  検証済み最新バージョン: **6.8.5**
 *  言語
 * [Catalan](https://ca.wordpress.org/plugins/wp-postviews/)、[Chinese (China)](https://cn.wordpress.org/plugins/wp-postviews/)、
   [Chinese (Taiwan)](https://tw.wordpress.org/plugins/wp-postviews/)、[Dutch](https://nl.wordpress.org/plugins/wp-postviews/)、
   [English (UK)](https://en-gb.wordpress.org/plugins/wp-postviews/)、[English (US)](https://wordpress.org/plugins/wp-postviews/)、
   [French (France)](https://fr.wordpress.org/plugins/wp-postviews/)、[Galician](https://gl.wordpress.org/plugins/wp-postviews/)、
   [Greek](https://el.wordpress.org/plugins/wp-postviews/)、[Japanese](https://ja.wordpress.org/plugins/wp-postviews/)、
   [Persian](https://fa.wordpress.org/plugins/wp-postviews/)、[Russian](https://ru.wordpress.org/plugins/wp-postviews/)、
   [Spanish (Chile)](https://cl.wordpress.org/plugins/wp-postviews/)、[Spanish (Spain)](https://es.wordpress.org/plugins/wp-postviews/)、
   [Spanish (Venezuela)](https://ve.wordpress.org/plugins/wp-postviews/)、[Swedish](https://sv.wordpress.org/plugins/wp-postviews/)、
   [Tibetan](https://bo.wordpress.org/plugins/wp-postviews/)、[Ukrainian](https://uk.wordpress.org/plugins/wp-postviews/)、
   [Vietnamese](https://vi.wordpress.org/plugins/wp-postviews/).
 *  [プラグインを翻訳](https://translate.wordpress.org/projects/wp-plugins/wp-postviews)
 * タグ
 * [Counter](https://ja.wordpress.org/plugins/tags/counter/)[hits](https://ja.wordpress.org/plugins/tags/hits/)
   [postviews](https://ja.wordpress.org/plugins/tags/postviews/)[views](https://ja.wordpress.org/plugins/tags/views/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/wp-postviews/advanced/)

## 評価

 5つ星中4.4つ星

 *  [  48 5-星レビュー     ](https://wordpress.org/support/plugin/wp-postviews/reviews/?filter=5)
 *  [  8 4-星レビュー     ](https://wordpress.org/support/plugin/wp-postviews/reviews/?filter=4)
 *  [  1 3-星レビュー     ](https://wordpress.org/support/plugin/wp-postviews/reviews/?filter=3)
 *  [  1 2-星レビュー     ](https://wordpress.org/support/plugin/wp-postviews/reviews/?filter=2)
 *  [  7 1-星レビュー     ](https://wordpress.org/support/plugin/wp-postviews/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-postviews/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/wp-postviews/reviews/)

## 貢献者

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)

## サポート

過去2ヶ月以内に解決した問題:

     0 / 2

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/wp-postviews/)

## 寄付

このプラグインが今後も改善できるよう応援しませんか ?

 [ このプラグインに寄付 ](https://lesterchan.net/site/donation/)