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のコメントでユーザーに画像のアップロードを許可する方法

WordPressのコメントでユーザーが画像やファイルを添付できるようにしたいですか?

画像とコメントは、どちらもWordPressサイトのユーザーエンゲージメントを高める強力なツールです。サイトのニッチやターゲットオーディエンスにもよりますが、訪問者がコメントで画像をアップロードできるようにすることで、サイトのユーザーエンゲージメントを大幅に高めることができます。

この投稿では、WordPressのコメントでユーザーが画像をアップロードできるようにする方法を紹介する。

Allow users to upload images in WordPress comments

なぜWordPressのコメントでユーザーが画像をアップロードできるようにするのか?

WordPressのコメントは、訪問者とコミュニケーションをとるための素晴らしい方法です。人々はフィードバックを残し、質問し、あなたのブランドを構築し、製品を改善するために有用な推奨事項を提供します。

ユーザーがコメントで画像をアップロードできるようにすると、ユーザー体験をさらに高めることができます。例えば、訪問者は問題のスクリーンショットをコメントで共有することができ、サポートチームに問題を解決するためのより多くの情報を与えることができます。

同様に、面白い写真やミームを共有することで、魅力的なディスカッションを始めることができる。これは、あなたのコメントを視覚的にアピールし、より楽しく読んでもらうのに役立ちます。

また、旅行ブログを運営しているのであれば、コメントする際に画像を許可することで、ユーザー生成コンテンツを集めることができる。例えば、ユーザーはお気に入りの旅行先や訪れた場所などの写真を共有することができる。

ということで、WordPressのコメントで画像のアップロードを許可する方法を見てみよう。

動画チュートリアル

Subscribe to WPBeginner

文章での説明がお望みなら、このまま読み進めてほしい。

WordPressのコメントでユーザーが画像をアップロードできるようにする

まず最初にDCO Comment Attachmentプラグインをインストールして有効化します。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

有効化したプラグインはすぐに動作し、WordPressのコメントエリアにファイルアップロードオプションを追加します。

WordPressのダッシュボードから、設定 ” DCOコメント添付 で設定を編集できます。

Change DCO comment attachment settings

このプラグインでは、最大アップロードファイルサイズの設定、添付ファイルの必須設定、添付ファイルの埋め込み、添付画像サイズの選択などが可能です。

また、ファイルタイプのオプションを設定することで、ユーザーがドキュメント、PDF、PowerPointプレゼンテーション、Excelスプレッドシートなど、さまざまな種類のファイルを添付できるようにすることもできます。

また、すべてのユーザーを選択するか、ログイン中のユーザーのみにWordPressコメントする添付ファイルのアップロードを許可するかのオプションもあります。

Choose file types to upload

変更が完了したら、忘れずに「変更を保存」ボタンをクリックしてください。

その後、WordPressブログの投稿ページに移動すると、下のスクリーンショットのようにコメントエリアに画像アップロードフィールドが表示されます:

Upload image attachment preview

ユーザーがアップロードした画像はすべてWordPressのメディアライブラリに保存されます。ユーザーによってアップロードされた画像を削除したい場合は、メディア ” ライブラリに移動し、画像を探してから削除する必要があります。

これにより、コメントするテキストに影響を与えることなく、コメントから画像が削除されます。

この機能の悪用を避けるために、サイトにコメントガイドラインを追加して、ユーザーがアップロードできる添付ファイルの種類を知らせることをお勧めします。例として、WPBeginnerのコメントポリシーページをご覧ください。

その後、WordPressのコメントフォームにコメントポリシーのテキストへのリンクを追加することができます。

画像の性質上、サイトに表示される前にすべてのコメントをモデレートしたい場合があります。そのためには、コメントモデレーションを有効化し、コメントがあなたのサイトで承認されたときにユーザーに通知します。

コメントするメディア機能をさらに高めるために、WordPressでコメントのoEmbedサポートを有効化することができます。これにより、ユーザーがアップロードした画像と一緒にYouTube動画、ツイート、Flickr写真などを埋め込むことができます。

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$編集プロセスをご覧ください。

アバター

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

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

  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. Mike Avery says

    There seems to be a new comment attachment plugin called, “DCO Comment Attachment”,

    Have you tried it yet? Can you recommend it?

    • WPBeginner Support says

      Not at the moment but once we find something we will certainly update the article :)

      管理者

    • WPBeginner Support says

      Apologies, the plugin we are currently recommending is no longer available. We will be sure to update the article with an alternative when we are able, after which we would be able to look into conditional loading.

      管理者

    • WPBeginner Support says

      Thanks for letting us know about that, we’ll be sure to look for an alternative

      管理者

  3. Jane Beinart says

    Is it possible to post photos this way via your mobile phone? I’m finding that posting photos via the computer is fine, but via iphone just gets an error message and says it is the wrong format of image. Any ideas as to how to make this work?

    • WPBeginner Support says

      It would depend on the file type of image that is being sent. If it is one of your allowed file types you would want to reach out to the support for the plugin to let them know and they should be able to assist.

      管理者

  4. Rachael says

    Is there anyway to filter the most top liked pictures to the top of the page?? Also is there a way for other users to reply to the comment? This worked but isn’t functioning the way I would like it to….

    • WPBeginner Support says

      It should allow people to reply the same way they would reply to a normal content but for what you’re asking for may require a custom plugin.

      管理者

  5. omer noiman says

    Hey, I did everything as described.
    when i am trying to test this, and upload an image, it redirects me to page 404

    The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. Please try another search …

      • Heidi says

        Hi, I am also having a page not found issue when trying to test this out by posting a comment with an image. The plugin support seems MIA. I did try what you suggested about the permalinks and I still can’t get my image to post. Any ideas? Thanks.

        • WPBeginner Support says

          You may want to check with your hosting provider that you are not hitting a memory limit as one possibility.

  6. Michael Vivar says

    Quick question. If I have an existing comment widget and I install “Comment Attachment”, will existing comments be affected?

  7. Chaz DeSimone says

    Fantastic plugin for uploading photos with recipes submitted by readers…until we install a “real” recipes plugin. Thank you!

  8. Rod Fleming says

    If it’s a hosted site and you are Admin, just click on the img button and enter the URL of the image. For a local image, first upload to the Media Library and copy the URL. Paste that into the img dialogue box in the comment section and add an alt tag when prompted. No Plug-in required.

    I can’t remember how long this has been available in WP but it’s a long time; I’ve been a user for nearly 10 years and it’s always been like this.

  9. Manasa says

    The wordpress website/s that I post comments to do not have the Upload Image option even though I know that users have posted images and so has the author/writer. But I do not know how else to upload an image without that option while posting comments.

  10. Traruh Synred says

    On a blog I post too I can’t load images. Others commenters do load images. They in could a link to the image.

    This doesn’t work for me. Yet the blog does allow images.

    I’ve tried various links in both email response and using WordPress reply. Niether works.. If I embed an image in an email it gets stripped out.

    I assume I’m doing something wrong, but can’t figure out what?

    E.g.,

  11. Amber says

    In Facebook, when you add a URL, it automatically sources the image for you. Is there a way to do that in WordPress comments?

  12. M.Khurram says

    On installation process this is happening
    Unable to create directory wp-content/uploads/2015/03. Is its parent directory writable by the server?

  13. Pamela says

    nice to be able to upload but the images are huge… they don’t retain their original size why??? can this be rectified so images stay in their original size??

  14. Marcus says

    While this is certainly a great way to boost user engagement, on some hosting platform this can pose a serious security issue. It is surprisingly simple to disguise a php script as a gif image. I strongly suggest using plugins like these only in combination with some .htaccess magic preventing scripts from being executed within your uploads folder. Especially on shared hosting platforms.

返信を残す

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