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.

С помощью настроек плагина вы можете:

  • Ограничить максимальный размер загружаемого файла.
  • Сделать вложение обязательным.
  • 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.
  • Включить/отключить множественную загрузку.
  • Объединить изображения в галерею.
  • 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.

Вы также можете:

  • Add, replace or delete an attachment from a comment on the Edit Comment screen.
  • Attach an unlimited number of attachments to the comment in the admin panel.
  • Delete an attachment from a specific comment or bulk delete attachments from comments on the Comments screen.
  • Display attachments attached to comments to the current post (or a specific post) with the [dco_ca] shortcode. You can also filter by type. See FAQ for details.

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

Поддерживается REST API.

DCO Comment Attachment также доступен на GitHub.


  • Примеры типов вложений.
  • A commenting form with an attachment field.
  • Список комментариев в админ-панели.
  • Screen for editing a comment in the admin panel.
  • Страница настроек плагина.
  • Пример лайтбокса с плагином Simple Lightbox.
  • An example of a drag and drop support.
  • An example of the new comment notification email.
  • Пример поддержки REST API.


  1. Загрузите папку dco-comment-attachment в каталог /wp-content/plugins/
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Часто задаваемые вопросы

Какие лайтбокс-плагины поддерживаются?

DCO Comment Attachment протестирован с:
* 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.

How to use the [dco_ca] shortcode?

Without attributes specified, the [dco_ca] shortcode will display all attachments attached to current post.

You can filter attachments using the type attribute. By default it is all. Also supported: image, video, audio and misc.
You can specify one value [dco_ca type="image"] or multiple values, separated by commas [dco_ca type="video,audio"].

You can also display attachments from the comments of another post using the post_id attribute.
For example, [dco_ca post_id="45"], where 45 is the ID of the specific post.

You can also combine these attributes. For example, [dco_ca post_id="45" type="image"] will display all images attached to comments to the post with ID 45.


This is an awesome plugin. I've been looking for something like this a long time. I hope the author Denis will keep update this plugin and won't abandon like others after a while. Just wondering, for some reason I have to disable your plugin, all the Youtube links and image attachements will be turned off too?
05.12.2021 1 ответ
im trying to translate to translate plugi strings such as ( The maximum upload file size, Attachment, etc) with loco translate, but the translation not working at the front end. how can i translate the strings ?
it's a very difficult plugin. ничё так, норм
14.02.2020 4 ответа
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.
Very grateful for providing these facilities. A finding at the precise moment.
Посмотреть все 6 отзывов

Участники и разработчики

«DCO Comment Attachment» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:


«DCO Comment Attachment» переведён на 5 языков. Благодарим переводчиков за их работу.

Перевести «DCO Comment Attachment» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений


  • Added bulk delete attachments action on the Comments screen.
  • Added the [dco_ca] shortcode for display attachments attached to comments (see FAQ for details).
  • Fixed bug: now if there is no attachment, the empty array is not saved to the database.


  • Fixed a bug with the accept attribute of the attachment upload field.
  • Added compatibility with Loco Translate plugin.


  • 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.


  • Добавлена возможность загружать несколько файлов.
  • Добавлена поддержка некоторых лайтбокс-плагинов (см. подробности в FAQ).
  • Added additional markup to the form elements (thank you @matthewmcvickar)
  • Added error handling for JavaScript on the frontend (thank you @mrbalkon)
  • Улучшена страница настроек
  • 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)
  • Убрана зависимость от jQuery на фронтэнде.


  • 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.
  • Добавлен хук dco_ca_disable_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.


  • Первая версия