Skip to content
Available for new work
Pages in Blog

ReferencePremium

CoullWorks Blog for Magento 2 events reference

The events you can observe, the observers the module registers and the extension attributes.

Updated 16 November 2026Back to the package pageBuy

Observe these events in your own module's events.xml.

Events you can observe#

Keys: post, category, tag, author, comment. Magento model events with prefix coullworks_blog_<entity>; the entity is passed under key <entity> (post, category, tag, author, comment). Model/Post.php etc. _eventPrefix.

coullworks_blog_<entity>_collection_load_before, _load_after#

Keys: post, category, tag, author, comment. Collection events with key <entity>_collection.

coullworks_blog_post_publish_after#

Keys: post (key post). Dispatched by PostRepository when a post has just become Published. Model/PostRepository.php:41.

coullworks_blog_comment_add_before#

Keys: comment, post + event data. Before a comment is stored (CommentManagement::store). Use to veto or alter.

coullworks_blog_comment_add_after#

Keys: comment, post. After a comment is stored; a failing observer cannot undo the comment.

coullworks_blog_comment_status_change_after#

Keys: comment, old_status, new_status. After approve/reject/spam.

coullworks_blog_listing_collection_load_before#

Keys: collection, listing. Before the listing page loads its posts; change the post collection.

coullworks_blog_structured_data_after#

Keys: documents (DataObject), context (PageContext). SeoEvents::STRUCTURED_DATA_AFTER: change, add or remove JSON-LD nodes once per page.

coullworks_blog_page_head_after#

Keys: head (DataObject: kind, url, canonical, alternates, prev, next, open_graph, twitter), context. SeoEvents::PAGE_HEAD_AFTER: change the head output before it is written.

coullworks_blog_ai_prompt_build_before#

Keys: transport (DataObject: kind, store_id, append). PromptBuilder::EVENT: set append to add "Additional instructions from the store's developers" to the prompt of kind research, writer, refresh or image.

coullworks_blog_ai_run_after#

Keys: run_id, step (research, outline, write, images, save, refresh). ResearchService::EVENT_RUN_AFTER after each AI step.

coullworks_blog_ai_draft_saved_after#

Keys: post, run_id. DraftSaver::EVENT_DRAFT_SAVED after the AI Writer saves a draft.

coullworks_blog_import_record_before#

Keys: record, transport (skip, data), job_id. Importer::EVENT_RECORD_BEFORE per source record: set skip or change data.

coullworks_blog_import_job_after#

Keys: job_id, result, dry_run. Importer::EVENT_JOB_AFTER when a job ends.

Events the module observes itself#

The module registers observers on these events. They are internal, but knowing them explains why a save reindexes search or clears a cache.

EventObservers and effect
coullworks_blog_category_delete_beforeObserver(s): RememberCategoryPosts. Remembers the posts of a category so their search documents refresh after it is deleted.
coullworks_blog_category_save_commit_after / _delete_commit_afterObserver(s): ReindexCategoryPosts + CleanFeedCache. Refreshes search documents of the category's posts and cleans feed cache.
coullworks_blog_tag_delete_before / _save_commit_after / _delete_commit_afterObserver(s): RememberTagPosts, ReindexTagPosts. Same for tags.
coullworks_blog_author_delete_before / _save_commit_after / _delete_commit_afterObserver(s): RememberAuthorPosts, ReindexAuthorPosts. Same for authors.
customer_delete_beforeObserver(s): AnonymiseCustomerComments. A deleted customer's comments lose the person but keep the text.
coullworks_blog_post_save_commit_afterObserver(s): CleanFeedCache, GenerateImageVariants. Cleans RSS feed cache; generates image variants.
coullworks_blog_post_delete_commit_afterObserver(s): CleanFeedCache. Cleans RSS feed cache.
admin_system_config_changed_section_coullworks_blog (adminhtml)Observer(s): CheckLicenseOnSave. Checks the licence key when the configuration section is saved.
adminhtml_cache_flush_all / adminhtml_cache_flush_system (adminhtml)Observer(s): RefreshLicenceIfMissing. Flushing caches checks any host with no verified licence answer.

Extension attributes#

InterfaceHow to extend
PostInterfaceCoullWorks\Blog\Api\Data\PostInterface is extensible; add attributes in your module and fill them with plugins on the repository (afterGet, afterGetList, afterSave), or with a join. Admin form fields named extension_attributes[<code>] are saved through the entity's extension object.
CategoryInterfaceCoullWorks\Blog\Api\Data\CategoryInterface is extensible; add attributes in your module and fill them with plugins on the repository (afterGet, afterGetList, afterSave), or with a join. Admin form fields named extension_attributes[<code>] are saved through the entity's extension object.
TagInterfaceCoullWorks\Blog\Api\Data\TagInterface is extensible; add attributes in your module and fill them with plugins on the repository (afterGet, afterGetList, afterSave), or with a join. Admin form fields named extension_attributes[<code>] are saved through the entity's extension object.
AuthorInterfaceCoullWorks\Blog\Api\Data\AuthorInterface is extensible; add attributes in your module and fill them with plugins on the repository (afterGet, afterGetList, afterSave), or with a join. Admin form fields named extension_attributes[<code>] are saved through the entity's extension object.
CommentInterfaceCoullWorks\Blog\Api\Data\CommentInterface is extensible; add attributes in your module and fill them with plugins on the repository (afterGet, afterGetList, afterSave), or with a join. Admin form fields named extension_attributes[<code>] are saved through the entity's extension object.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.