Update multiple blog posts that match the filter criteria.
Args:
filter_criteria: Dictionary containing fields to filter posts by, example:
{
"status": "draft",
"tag": "news",
"featured": True
}
Supported filter fields:
- status: Post status (draft, published, etc)
- tag: Filter by tag name
- author: Filter by author name
- featured: Boolean to filter featured posts
- visibility: Post visibility (public, members, paid)
update_data: Dictionary containing the fields to update. The updated_at field is required.
All fields supported by the Ghost API can be updated:
- slug: Unique URL slug for the post
- title: The title of the post
- lexical: JSON string representing the post content in lexical format
- html: HTML version of the post content
- comment_id: Identifier for the comment thread
- feature_image: URL to the post's feature image
- feature_image_alt: Alternate text for the feature image
- feature_image_caption: Caption for the feature image
- featured: Boolean flag indicating if the post is featured
- status: The publication status (e.g., published, draft)
- visibility: Visibility setting (e.g., public, private)
- created_at: Timestamp when the post was created
- updated_at: Timestamp when the post was last updated (REQUIRED)
- published_at: Timestamp when the post was published
- custom_excerpt: Custom excerpt text for the post
- codeinjection_head: Code to be injected into the head section
- codeinjection_foot: Code to be injected into the footer section
- custom_template: Custom template assigned to the post
- canonical_url: The canonical URL for SEO purposes
- tags: List of tag objects associated with the post
- authors: List of author objects for the post
- primary_author: The primary author object
- primary_tag: The primary tag object
- og_image: Open Graph image URL for social sharing
- og_title: Open Graph title for social sharing
- og_description: Open Graph description for social sharing
- twitter_image: Twitter-specific image URL
- twitter_title: Twitter-specific title
- twitter_description: Twitter-specific description
- meta_title: Meta title for SEO
- meta_description: Meta description for SEO
- email_only: Boolean flag indicating if the post is for email distribution only
- newsletter: Dictionary containing newsletter configuration details
- email: Dictionary containing email details related to the post
Example:
{
"updated_at": "2025-02-11T22:54:40.000Z",
"status": "published",
"featured": True,
"tags": [{"name": "news"}, {"name": "featured"}],
"meta_title": "My Updated Title",
"og_description": "New social sharing description"
}
ctx: Optional context for logging
Returns:
Formatted string containing summary of updated posts
Raises:
GhostError: If there is an error accessing the Ghost API or missing required fields