Det här tillägget har inte testats med någon av de 3 senaste huvudversionerna av WordPress. Det kanske inte längre underhålls och kan ha kompatibilitetsproblem när det används tillsammans med nyare versioner av WordPress.

Comment Attachment


This plugin allows your visitors to attach files with their comments, such as documents and images. It uses only built in wordpress hooks, and provides you with multiple settings in you admin (using native WP_Settings API). With these you can:

  • Select if the upload field is before or after the default comment fields.
  • Make attachment a required field.
  • Select a label of upload field (default is ’Upload Attachment’)
  • Select a label of attachment in comment text (default is ’Attachment:’)
  • Select which file types are allowed to be attached.
  • Select if attachment is visible in the the actual comment.
  • Select if attachment should be attached to post your visitor comments on, or not.
  • Select position of attachment in comment, either before the main comment, or after it.
  • Decide whether attachment can be downloaded.
  • Decide if the attachment image should be displayed in a comment and select image size (it automatically loads all image sizes set up in your wordpress installation and by your theme using ’add_image_size’)
  • Restrict file size of uploaded attachment.
  • Try WordPress 3.6^ experimental audio / video player.

All attachments are inserted in your main wordpress media gallery, and are attached (if set in settings) to current commented post. (if set in settings). Upon comment deletion the attachment in that comment is deleted as well (if set in settings).

If an error occurs, like required attachment, or visitor trying to upload not allowed file type, plugin uses native wp_die() to handle the error, which can play nicely, if you use some other plugin for handeling comment form errors in a different way, like this one.

To control the output, in your css, you can use these classes and id’s. For form elements:

.comment-form-attachment {}
.comment-form-attachment label .attachmentRules {}
.comment-form-attachment input#attachment {}

and for inner comment elements:

.attachmentFile {}
.attachmentFile p {}
.attachmentLink {}
.attachmentLink img {}

It should be easy peasy for you to style it! 🙂

= Language translations thanks to:

  • DE = =
  • PT = Nomada (rodrigo)
  • BR = Treed Box
  • ES = Clara Roldan
  • DK = Johan Michaelsen

Thank you all for contributing.


  • Settings page in wp admin. Settings > Discussion > Comment Attachment
  • Attachment field in comment form.
  • Attachments in comments with links and image thumbnails.
  • WordPress 3.6.x video player
  • WordPress 3.6.x audio player


  1. Go to your admin area and select Plugins -> Add new from the menu.
  2. Search for ”Comment Attachment”.
  3. Click install.
  4. Click activate.

Vanliga frågor

Installation Instructions
  1. Go to your admin area and select Plugins -> Add new from the menu.
  2. Search for ”Comment Attachment”.
  3. Click install.
  4. Click activate.


juli 16, 2019
I can install it and config it. I enabled everything for using markup and upload on comments. But the ability to upload appears for no one. Not even the admin. I'm afraid this plugin indeed no longer works with current wordpresses.
oktober 17, 2018
Works ok, but it thinks I can only upload files of 1mb. My php.ini and server allows uploads up to 1GB, wordpress uploads show this everywhere else. This plugin only can do 1mb max.. seems to be a bug, no way to fix it. Uninstalled.
juni 19, 2018
Comment Attachment is super useful thanks for making it! Hope .txt file type will be added soon 🙂
maj 10, 2018
Could you please lower the maximum file size from MB to KB? Now, the minimum file size is 1MB, but in my case it's even too big, so I want to allow upload only up to some hundrets kilobytes e.g. up to 500kB. Cheers
april 19, 2017
Works like a charm, does everything like it promises to do. However, since the support for this plugin is being abandoned (said the author himself), it would be a waste to stop developing it further. I hope someone will pick it up from here and continue to support this plugin. If anyone has 404 error issues with this plugin (like I had), please see post in the Support thread of this plugin, the topic called "bug in with home_url()", Started by: Hrohh it is easy to fix.
Läs alla 20 betyg

Bidragsgivare och utvecklare

”Comment Attachment” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

”Comment Attachment” har översatts till 3 språk. Tack till översättarna för deras bidrag.

Översätt ”Comment Attachment” till ditt språk.

Intresserad av programutveckling?

Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.



  • Tested on latest WordPress 4.4
  • Added languages support (thanks to winnewoerp)
  • Added German translation (thanks to winnewoerp)
  • Added new plugin icon


  • Added ability to delete attachment from wordpress admin.
  • Attachment added to notification e-mail message


  • Added new allowed file types (APK)
  • Added rel=”lightbox” to image links
  • Better requirements check


  • Experimental featured image feature removal, bug-fix.


  • Categorized file types in the admin
  • Added new allowed file types (RAR, ZIP, WMA, MP4, M4V, MOV, WMV, AVI, MPG, OGV, 3GP, 3G2, FLV, WEBM)
  • Added experimental audio / video player, using native [video] and [audio] shortcode
  • Added media gallery allowed mime types fix
  • Added maxium file size info into comment form.


  • Added new allowed file types (PPT, PPTX, PPS, PPSX, ODT, XLS, XLSX, MP3, M4A, OGG, WAV)
  • Added max. file size settings.
  • Added loads of non-official but used mime types.
  • Added file extension check.
  • Added option to change attachment title in comment text.


  • Fixed small typos.
  • Plugin released.