DCO Comment Attachment


DCO Comment Attachment allows your visitors to attach images, videos, audios, documents and other files with their comments. They will also be able to automatically embed links from Youtube, Facebook, Twitter and other services in the comment text.

With plugin settings you can:

  • Limit the maximum file upload size.
  • Make an attachment required.
  • Specify whether the attachment will be embedded or displayed as a link.
  • Enable/Disable autoembed links (like Youtube, Facebook, Twitter, etc.) in the comment text.
  • Select an attachment image size from thumbnails available in your WordPress install.
  • Link a thumbnail to a full-size image with lightbox plugins support (see FAQ for details).
  • Open a full-size image in a new tab or link thumbnail to the attachment page.
  • Enable/Disable multiple upload.
  • Combine images to gallery.
  • Select an attachment image size for the images gallery.
  • Restrict attachment file types.
  • Decide who will be able to upload attachments: all users or only logged users.
  • Manually moderate comments with attachments.

You can also:

  • Add, replace or delete an attachment from a comment on Edit Comment screen.
  • Attach an unlimited number of attachments to the comment in the admin panel.
  • Delete an attachment on Comments screen.

Attachments are uploaded to the WordPress Media Library and deleted along with the comment (if this is set in the settings).

REST API is supported.

DCO Comment Attachment is also available on GitHub.


  • Examples of attachment types.
  • A commenting form with an attachment field.
  • List of comments in the admin panel.
  • Screen for editing a comment in the admin panel.
  • Plugin settings page.
  • An example of a lightbox with the Simple Lightbox plugin.
  • An example of a drag and drop support.
  • An example of the new comment notification email.
  • An example of REST API support.


  1. Upload dco-comment-attachment folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress


What lightbox plugins are supported?

DCO Comment Attachment tested with:
* Simple Lightbox
* Easy FancyBox
* Responsive Lightbox & Gallery
* FooBox Image Lightbox
* FancyBox for WordPress

Feel free to create a new topic on support forum if you need integration with another plugin.


18 верасня, 2020
it's a very difficult plugin. ничё так, норм
14 лютага, 2020
This is good, but it definitely needs access controls, such as limiting the function to logged in users (not allowing anonymous users to post attachments), otherwise it's just too risky too use.
1 ліпеня, 2019
Very grateful for providing these facilities. A finding at the precise moment.
Read all 4 reviews

Contributors & Developers

“DCO Comment Attachment” is open source software. The following people have contributed to this plugin.


“DCO Comment Attachment” has been translated into 4 locales. Thank you to the translators for their contributions.

Translate “DCO Comment Attachment” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Added allowed file types to the file input dialog box. (thank you @pranciskus)
  • Added REST API support (thank you @daohoangson)
  • Added dco_ca_force_download_misc_attachments filter for force download files instead of open.
  • Improved check/uncheck allowed file types on Settings page.
  • Fixed “Trying to get property ‘comment_ID’ of non-object” bug. (thank you @pranciskus)


  • Added drag and drop support for attachment input field.
  • Improved “Link thumbnail?” option. Link to a new tab and an attachment page (thank you @nourijp) is now supported.
  • Fixed bug with “Manually moderate comments with attachments” option. (thank you @thompro)
  • Removed “Attach to commented post?” option from the Settings page. You can use the dco_ca_attach_to_post filter instead.


  • Added new filters for the attachment markup customization: dco_ca_get_attachment_preview and dco_ca_get_attachment_preview_image.


  • Added links to attached attachments to the new comment notification email.
  • Added the feature to force moderation comments with attachments.
  • Added compatible with SVG Support plugin.


  • Added the feature to upload multiple files.
  • Added support for some lightbox plugins (see FAQ for details).
  • Added additional markup to the form elements (thank you @matthewmcvickar)
  • Added error handling for JavaScript on the frontend (thank you @mrbalkon)
  • Improved Settings page
  • Filter dco_ca_form_element_autoembed_links_notification is deprecated. Use dco_ca_form_element_autoembed_links instead.
  • Type autoembed-links-notification for form_element function is deprecated. Use autoembed-links instead.


  • Fixed image embed bug when attachment url has get parameters (thank you @deepreef)


  • Added the feature to link a thumbnail to a full-size image.
  • Added the feature for restrict uploading attachments only to logged users.
  • Added notification about automatically embedded links, when it’s enabled.
  • Fixed bug with incorrect display of attachment types that do not support embedding. (thank you @nazzareno)
  • Removed jQuery dependency on the frontend.


  • Fixed Quick Edit Comment function bug (thank you @bbceg)


  • Added the feature for autoembed links in comment text. You can disable it in Settings -> DCO Comment Attachment.
  • Introduced dco_ca_disable_display_attachment hook. Now you can display attachment in custom place with add_filter('dco_ca_disable_display_attachment', '__return_true'); filter and dco_ca()->display_attachment() function.


  • Fixed display of empty allowed types if the website administrator has forbidden the upload of all extensions of this type. (thank you @nunofrsilva)


  • Added filters for the attachment field customization


  • Now you can select and deselect Allowed File Types by the type in one click.
  • Added dco_ca_disable_attachment_field hook for disable the upload attachment field.
  • Reduced the effect of mime types filtering. Now it applies only for comment attachment upload.
  • Added the feature to attach an attachment to a commented post.


  • Initial Release