Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressでテーマ開発のためのダミーコンテンツを追加する方法

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

テーマ開発やWordPressテストのためにダミーコンテンツを追加したいですか?

ダミーコンテンツを追加すると、空のWordPressサイトをプレースホルダーコンテンツで埋めることができます。これによって、サイトがどのように見えるか、テーマやプラグインがコンテンツによってどのように見えるかを確認することができます。

この投稿では、WordPressのテーマ開発において、ダミーコンテンツを簡単に追加する方法を紹介する。

Adding dummy content in a WordPress website for theme development and testing

WordPressテーマのユニットテストデータとは?

WordPress テーマのユニットテストデータは、テストや開発を目的としたテーマのデモコンテンツを含む XML ファイルです。

WordPress.orgのテーマレビューチームによって管理されており、WordPress.orgのテーマディレクトリに送信されたテーマのテストにも使用されています。

このWordPressダミーデータジェネレータを使えば、ブログ投稿やページの作成、画像のインポートなどが簡単にできます。もしよろしければ、このダミーデータをお役立てください:

私たちは、WordPressホスティングサービスのレビューで、このWordPressダミーコンテンツジェネレータを定期的に使用し、実際のホスティングアカウントのパフォーマンスをテストしています。

このチュートリアルでは、WordPressにダミーコンテンツを追加する初心者向けの2つの方法を取り上げます。以下のクイックリンクから、使いたい方法にジャンプできます:

方法1:WordPressテーマのユニットテストデータを使ってダミーコンテンツを追加する

まず、GitHubのTheme Unit Testプロジェクトにアクセスし、「Code」ボタンをクリックしてzipファイルをコンピューターにダウンロードする必要がある。

Get Theme Unit Test XML file

ファイルをダウンロードしたら、コンピューターに解凍する必要があります。テーマ・ユニットテスト・マスター(theme-unit-test-master)」というフォルダーにファイルが展開されます。

このフォルダーの中には、必要なダミーデータをすべて含む「themeunittestdata.wordpress.xml」を含む3つのファイルがあります。

Dummy data XML file

これで、ダミー・データ・ファイルをWordPressサイトにインポートすることができます。

理想的には、ローカルサーバーを実行しているコンピューター上のテストサイトにインポートすることです。ステージングWordPressサイトを作成してテストすることもできます。

テストサイトのWordPress管理エリアにログインし、ツール ” インポートページに移動します。ここからWordPressインポーターオプションまでスクロールダウンし、「今すぐインストール」リンクをクリックします。

Install the WordPress importer

インストーラがインストールされると、WordPressが自動的に有効化します。

インポーターを起動するには、’Run Importer’リンクをクリックする必要があります。

Run importer

次の画面で「Choose File」ボタンをクリックします。

次に、先ほどダウンロードしたテーマ・ユニットテストXMLファイルを選択します。

Choose dummy data XML file

ファイルのアップロードとインポート」ボタンをクリックして続行します。

WordPressはインポートファイルの添付ファイルを確認し、既存の投稿者をインポートするか、サイトの別のユーザーに記事を割り当てるかを尋ねます。

Importing dummy data in WordPress options

投稿者のインポートを選択すると、WordPressがその投稿者のためのダミーのユーザーアカウントを作成します。インポートしたコンテンツをサイトの既存ユーザーに割り当てることもできます。

最後に、添付ファイルをインポートするボックスにチェックを入れます。こうすることで、WordPressが画像をダウンロードし、WordPressのメディアライブラリに保存します。

最後に「送信」ボタンをクリックして、インポーターを実行します。

ダミーデータがWordPressブログやサイトにインポートされます。完了すると成功のメッセージが表示されます。

WordPress dummy data generated successfully

あなたのサイトにアクセスして、インポートされたコンテンツを実際に見ることができます。

テーマ・ユニットテストのデータには何が含まれますか?

WordPressテーマをテストするために必要なものはすべて、テーマのユニットテストデータに詰まっています。

Dummy data generated in default WordPress theme

カテゴリー、子カテゴリー、メニュー項目、ネストされたコメント、ページ、サブページ、さまざまなサイズの画像、画像の配置などがある。

また、リスト、ブロッククォート、リンク、コードなど、テーマでスタイル設定すべきHTMLタグもあります。

ブロックエディターを使用している場合、テストデータにはカバーブロック、ボタン、様々なレイアウトのギャラリー、カラム、その他テストしたい一般的なブロックが含まれています。

Dummy gallery block

WordPress用のダミーコンテンツ・ジェネレータ・プラグインを使用するよりもはるかに優れたダミーデータの包括的なセットです。

方法2:プラグインを使ってWordPressでダミーデータを生成する

生成するダミーデータの量をもっとコントロールしたい場合は、WordPress用のダミーデータジェネレータプラグインを使用するとよいでしょう。

まず、FakerPressプラグインをインストールして有効化する必要があります。詳しくは、WordPress プラグインのインストール方法をご覧ください。

有効化したら、WordPress ダッシュボードからFakerPress ” 投稿ページにアクセスして、ダミー投稿を生成する必要があります。

Generating dummy posts in WordPress

このプラグインでは、投稿やページだけでなく、カスタム投稿タイプも生成できます。

まず、生成したい投稿の範囲を選択する必要があります。

その後、日付範囲、投稿タイプ、投稿者、その他のオプションを選択できます。また、ダミーのプレースホルダー画像ソースから画像をインポートしたり、投稿内でHTMLを使用したり、各項目のコメント数を設定したりすることもできます。

Content settings for fake data generator

満足したら、一番下の「ジェネレータ」ボタンをクリックします。

プラグインは、あなたが提供した設定を使用してWordPress用のダミーコンテンツを生成します。これで、あなたのサイトにアクセスして、実際に動作するのを確認することができます。

Clicking the Generate button in FakerPress

FakerPressでは、ダミーのWordPressコメントを簡単に生成したり、ダミーのユーザーアカウントを追加したり、カテゴリー、タグ、その他のカスタムのタクソノミー用語を作成したりすることもできます。

この投稿が、WordPressでテーマ開発のためにダミーコンテンツを簡単に追加する方法を学ぶのにお役に立てば幸いです。また、インスピレーションを得るための最高の無料WordPressテーマの究極のリストや、WordPressテーマでショートコードを使用する方法についてのガイドもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

24件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Dennis Muthomi says

    I have a quick question – I’ve noticed that some theme demos and previews use Lorem Ipsum text as content. Could using Lorem Ipsum be another way to add dummy content, in addition to the Theme Unit Test Data and FakerPress plugin you covered here? Just curious if that’s a viable option too

    • WPBeginner Support says

      Lorem Ipsum is normally what is included in the text area, the dummy content from this guide should create posts and other containers for that content. So it would work together in that sense :)

      管理者

  3. Tanish Mittal says

    Do you know how to make dummy content for your customer? I just dev a theme and I want to sell but I also have a dummy XML file etc. How to make it?

    • WPBeginner Support says

      The simplest method would be to export a demo site you create to have demo content for your theme.

      管理者

  4. David Hahn says

    there appears to be something wrong with the file. It’s not zipped! your link only opens in a window with unpacked code; message:

    “This XML file does not appear to have any style information associated with it. The document tree is shown below.”

  5. Brent Robinson says

    Wow! I’ve been creating this stuff one my own. Never thought to export it and reused it – DUH.

    Thanks for the amazing started kit. Happy developing.
    b.

  6. Alex Hoffman says

    Thank you, not all of it worked during the upload but it was mostly images. Either way, this made my life a ton easier. Thank you much, also, maybe take out the deprecated stuff? just a thought.

  7. chemistrap says

    Sometimes we download multi-purpose themes then we imports dummy data or sample xml file but I dont need unnecessary pictures, pages, posts, etc.. How can i seperate / edit this dummy data without notepad?
    Why asking this question cause i done a project my subdomain after then i migrate to my main website but I realized theme files size is about 500 Mb. and i removed unnecessary pictures in uploads file.
    There is question : How can i seperate unnecessary pictures, pages etc. in XML file before i upload ?
    Thnx

  8. shruti says

    i did as told but on uploading it shows this message
    Failed to create new user for themedemos. Their posts will be attributed to the current user.
    Failed to create new user for chipbennett. Their posts will be attributed to the current user.
    Failed to create new user for lance. Their posts will be attributed to the current user.
    Failed to create new user for emiluzelac. Their posts will be attributed to the current user.
    please help as I cannot see any dummy post in my wordpress except form hello world.

  9. Elliott Richmond says

    Theme unit test data is awesome, I’ve only recently started to use it and its a true life saver – gone are the days of waiting for css issues to be discovered, you can nail them all in one hit!

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。