[WordPress] プラグイン「WordPress Popular Posts」で黄色の警告が表示された場合の対処法

WordPressで人気記事を表示するプラグイン「WordPress Popular Posts」で黄色の警告が出てきてしまった時の対処法をご紹介します。
黄色の警告が表示される
ある日サイトを確認すると、人気記事を表示していた場所に以下の黄色の警告が表示されていました。

【翻訳】
管理者への重要なお知らせ: WordPress Popular Posts の「クラシック」ウィジェットは削除されました。
このウィジェットはバージョン 7.0 でサポートが終了しました。人気の投稿リストを WordPress の人気の投稿ブロックまたは wpp ショートコードに移行する手順については、[外観] > [ウィジェット] > [サイドバー] > WordPress の人気の投稿に移動してください。
つまり、「WordPress Popular Posts」を引き続き使用する場合
・ブロックウィジェットを使用して表示する
・wppショートコードを使用して表示する
のいずれかの方法を使うことになります。
ブロックウィジェットを使用して表示する
「外観」→「ウィジェット」を選択
表示させたい場所で「+」をクリックしてブロックを追加

ブロック一覧から「Wordpress Popular Posts」を選択

 
WordPress Popular Post の設定をする
wppショートコードを使用して表示する
「WordPress Popular Posts」専用のwppショートコードを使用する方法です。
パラメータで表示の設定が細かく行えます。
sidebar.php
例1:過去30日間で閲覧数の多い5件をサムネイル付きで表示
| 1 | <?php echo do_shortcode("[wpp range='last30days' order_by='views' limit=5 thumbnail_width='100' thumbnail_height='100']"); ?> | 
例2:例1+閲覧数は非表示、タイトル付き、オリジナルタグで表示、
| 1 | <?php echo do_shortcode("[wpp header='月間アクセスランキング' post_type='post' range='last30days' limit=5 order_by='views' thumbnail_width='100' thumbnail_height='100' stats_views=0 header_start='<h2>' header_end='</h2>' wpp_start='<div class="bs_post_list bs_post_list_rank">' wpp_end='</div>' post_html='<dl> <dt>{thumb}</dt> <dd> <h4> {title} </h4> </dd> </dl>']"); ?> | 
主なパラメータ一覧
| パラメータ | 説明 | 例 | ||
|---|---|---|---|---|
| header | 見出しを指定 | 
 | ||
| post_type | 投稿タイプを指定 例:post, page | 
 | ||
| range | 集計期間 例:last24hours, last7days, last30days, all, custom | 
 | ||
| limit | 表示する投稿数 例:5, 10 | 
 | ||
| thumbnail | サムネイル画像の表示 | 
 | ||
| stats_views | 投稿の総閲覧数を表示するか 例:true, false, 0 | 
 | ||
| excerpt_length | 抜粋の文字数を制限 | 
 | 
![MARKLEAPS[マークリープス]](https://markleaps.com/blog/wp-content/themes/mkl/images/00_logo.png)
 
                        
![[WordPress] プラグイン「WP ALL Import」で既存記事を一括更新(CSV上書き)する方法](https://markleaps.com/blog/wp-content/uploads/2025/10/wp-all-import_update-500x254.jpg)
![[WordPress] CSVで記事を一括インポート-プラグイン「WP ALL Import」の使い方](https://markleaps.com/blog/wp-content/uploads/2025/10/wp-all-import-500x254.jpg)
![[WordPress] 記事への画像挿入方法](https://markleaps.com/blog/wp-content/uploads/2025/10/pic_manual_mainimg-500x254.png)
![[WordPress] カテゴリーとタグの違いと設定方法](https://markleaps.com/blog/wp-content/uploads/2025/10/wp-category-tag-500x254.jpg)