
ePublishing Ask My Brand Feed
v1.6.0askmybrand · 2026年4月13日 上架
Provides a secure, full-content RSS feed for Ask My Brand integration.
- 正在使用
- 20+
- 评分
- 暂无
- 累计下载
- 679
- 最近更新
- 2026年11月6日
贡献者
This plugin creates a secure RSS feed endpoint that delivers full post and page content for integration with ePublishing’s Ask My Brand AI-powered search.
Features:
- Token-based authentication to protect your content
- Full content (not just excerpts)
- Posts and pages in a single feed, each item labelled with its content type
- Pagination support for large archives
- Category and content type filtering, plus a per-site category exclusion list
- Last modified dates for efficient sync
Every item carries an <askmybrand:content_type> element — Article for posts, Page for pages — so the indexer can tell them apart. Pages can be excluded entirely from Settings Ask My Brand.
External Services
This plugin is designed to integrate with Ask My Brand, a third-party AI-powered search service provided by ePublishing.
What the service is and what it’s used for:
Ask My Brand is an AI-powered content search and discovery service that indexes your WordPress content to provide intelligent search capabilities for your audience. The plugin creates a secure RSS feed that the Ask My Brand service accesses to retrieve and index your published content.
What data is sent and when:
When Ask My Brand’s service accesses your feed (using the token-authenticated URL you provide), the following data is transmitted:
– Published post and page titles
– Published post and page content (full text, with <script> and <style> blocks removed)
– Post and page URLs
– Publication dates and last modified dates
– The content type of each item (Article or Page)
– The URL, dimensions and caption (or alt text) of each item’s featured image
– Post categories
– Post and page authors
Site code can extend the feed to further content types (for example WooCommerce products) using the epubamb_content_types filter described under “For developers”; doing so adds those items’ titles, content and URLs to what is transmitted. No content type beyond posts and pages is included unless the site explicitly adds it.
Categories can be excluded from the feed entirely in Settings Ask My Brand; posts in an excluded category, or in any of its child categories, are never transmitted.
This data is only sent when Ask My Brand’s servers request the feed URL. No data is automatically transmitted without the feed being accessed. The feed only includes published posts and pages, excludes password-protected content, excludes anything marked noindex in Yoast SEO or Rank Math or ticked “Hide from Ask My Brand” on the edit screen, excludes items with neither content nor an excerpt, and respects WordPress content visibility settings. Pages can be excluded from the feed entirely in Settings Ask My Brand.
Service provider information:
– Service: Ask My Brand by ePublishing
– Terms of Service: https://askmybrand.ai/terms-of-service
– Privacy Policy: https://askmybrand.ai/privacy-policy
– Service Website: https://askmybrand.ai/
By using this plugin and providing the feed URL to Ask My Brand, you consent to share your published content with the Ask My Brand service for indexing and search purposes.
Usage
Once activated, your feed is available at:
/feed/ask-my-brand/?token=YOUR_TOKEN
With Plain permalinks it is /?feed=ask-my-brand&token=YOUR_TOKEN instead; Settings Ask My Brand shows the exact URL for your site.
Parameters:
paged— Page number (default: 1)per_page— Items per page, max 100 (default: 50)category— Category slug or comma-separated slugs (default: all)content_type—Article,Page, or any label a developer has added, comma-separated (default: every type enabled in settings)
Examples:
/feed/ask-my-brand/?token=xxx&paged=2&per_page=25/feed/ask-my-brand/?token=xxx&category=news/feed/ask-my-brand/?token=xxx&content_type=Page/feed/ask-my-brand/?token=xxx&category=news,blog&per_page=100
Notes:
- Pages carry no categories, so filtering by
categoryreturns posts only. - Categories excluded in Settings Ask My Brand are removed before any
categoryparameter is applied, and are reflected intotalPosts/totalPages. Excluding a parent category also excludes its children. - If pages are disabled in Settings Ask My Brand,
content_type=Pagereturns an empty feed rather than falling back to posts. - An unrecognised
content_typevalue is ignored, and the feed returns every enabled type. - Requesting a page number past the end of the results returns an empty feed with a 404 status; treat that as end-of-stream.
Feed format
The feed is standard RSS 2.0, so any RSS parser reads it. The additions live in the askmybrand namespace, declared once on the root element:
<rss version="2.0" xmlns:askmybrand="https://askmybrand.ai/feed" xmlns:media="http://search.yahoo.com/mrss/" ...>
Featured images use the standard Media RSS (media) namespace.
Channel level. One <askmybrand:pagination> block describes the whole result set, so a crawler can size the job before walking it:
<askmybrand:pagination>
<askmybrand:currentPage>1</askmybrand:currentPage>
<askmybrand:perPage>50</askmybrand:perPage>
<askmybrand:totalPosts>130</askmybrand:totalPosts>
<askmybrand:totalPages>3</askmybrand:totalPages>
<askmybrand:contentTypes>Article,Page</askmybrand:contentTypes>
</askmybrand:pagination>
totalPostsandtotalPagesdescribe the filtered set, not the whole site — request?category=newsand they count only that category.contentTypeslists the types this particular request can actually return. It is not a list of what the site has: under acategoryfilter it drops toArticle, because pages and most custom types carry no categories.categoriesis present only when you passedcategory, echoing back the slugs that were applied. It reports the slugs actually in force, so a site whoseepubamb_feed_query_argsfilter replaced them will not see it.
Item level. Each <item> carries the standard RSS fields plus these:
<item>
<title>Example post</title>
<link>https://example.com/example-post/</link>
<pubDate>Mon, 15 Sep 2025 12:00:00 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<category><![CDATA[News]]></category>
<content:encoded><![CDATA[<p>The full post content.</p>]]></content:encoded>
<lastModified>Tue, 16 Sep 2025 09:30:00 +0000</lastModified>
<askmybrand:content_type>Article</askmybrand:content_type>
<media:thumbnail url="https://example.com/wp-content/uploads/example-300x200.jpg" width="300" height="200" />
<media:description>A caption for the image</media:description>
</item>
<content:encoded>is the full content, never an excerpt, regardless of Settings Reading — unless the item has no content, in which case WordPress sends its excerpt. Content after a<!--nextpage-->break is included;<script>and<style>blocks are removed.<lastModified>is when the item last changed, in GMT: the later of its last edit and its publication, so a scheduled post counts as changed when it goes live. Use it for incremental sync.<pubDate>remains the publication time.<askmybrand:content_type>isArticlefor posts,Pagefor pages, or whatever label the site has registered for a custom type. It is omitted, rather than guessed at, for a type the feed has no label for.<media:thumbnail>is the item’s featured image at WordPress’smediumsize, and<media:description>its caption, falling back to its alt text and then its title, as plain text. Both are omitted when the item has no featured image;<media:description>is also omitted when all three are empty.
Crawling. Items are ordered by <lastModified>, newest first, so an incremental sync can stop at the first item whose <lastModified> is older than the moment its last run started — an old page edited yesterday is at the top, not buried by its publication date. Measure from the start, not the end: an item edited mid-crawl jumps to page 1, which that run has already fetched, so only the next run sees it. Walk paged from 1 until currentPage reaches totalPages. Requesting a page past the end returns an empty but well-formed feed with a 404 status and no pagination block — treat that as end-of-stream rather than an error, and never as the site having no content.
Excluded content. Drafts, pending, private and password-protected items never appear, and neither do attachments. The feed carries only published, publicly visible content. Items marked noindex in Yoast SEO or Rank Math are excluded too — per item, or through the post type’s default, following the same rules those plugins use for the page’s robots tag — as is anything ticked “Hide from Ask My Brand” in the edit screen’s Ask My Brand box, and any item with neither content nor an excerpt. WordPress’s own “Discourage search engines” setting is deliberately ignored, since staging sites routinely have it on. Sites can exclude further content by category in Settings Ask My Brand, or by any WP_Query criterion with the epubamb_feed_query_args filter.
Only the feed’s own URL serves content. WordPress also exposes /<slug>/feed/ask-my-brand/, /comments/feed/ask-my-brand/ and archive forms such as /category/news/feed/ask-my-brand/ as a side effect of registering a named feed, and the same applies to WordPress query variables added to the feed URL — &cat=, &year=, &tag=, &s= and the like. All of these return 404. Use the documented category and content_type parameters instead. The one exception is the posts page of a site with a static front page (for example /blog/feed/ask-my-brand/), which serves the same feed as the canonical URL.
For developers
Posts and pages are in the feed out of the box. Other content types — WooCommerce products, or any custom post type — are opt-in, because this feed transmits content to a third party and installing a plugin must never widen that payload on its own.
Add one with the epubamb_content_types filter, which maps a post type to the label the feed reports:
add_filter( 'epubamb_content_types', function ( $types ) {
$types['product'] = 'Product';
return $types;
} );
Products then appear in the feed as <askmybrand:content_type>Product</askmybrand:content_type>, and callers can request ?content_type=Product to fetch only those. Several types may share a label — label a news type Article and ?content_type=Article returns posts and news together. Labels may not contain a comma.
Notes:
- The label is part of the feed’s public contract — the indexer sees it, and callers filter on it. Use a stable literal, not a translated post type label, or the value changes with the site’s locale.
- Register the post type by the
initaction, as WooCommerce and most plugins do. A type registered later is dropped from the map, because the feed refuses to advertise a type it cannot query. - Types you add inherit the feed’s behaviour: full content, password-protected items excluded, and the
content_typeelement on every item. - Filtering by
categoryreturns posts only. Pages and most custom post types do not carry thecategorytaxonomy, so they are excluded from a category-filtered request and are not listed in<askmybrand:contentTypes>for it. - A post type that is not registered — its plugin deactivated, say — is dropped from the map, so the feed never advertises a type it cannot return.
- Settings Ask My Brand lists the content types currently in the feed, which is the quickest way to confirm a filter took effect.
Changing what the feed selects: epubamb_feed_query_args
Settings Ask My Brand covers excluding whole categories. For anything else — a different taxonomy, a meta key, an exclusion built at runtime — filter the WP_Query arguments the feed runs on:
add_filter( 'epubamb_feed_query_args', function ( $query_args, $request ) {
unset( $query_args['category_name'] ); // drop the slug allow-list
$query_args['cat'] = '-12,-15'; // exclude categories 12 and 15
return $query_args;
}, 10, 2 );
$query_args is the array handed to `WP_Query`; `$request` is the parsed feed request (`paged`, `per_page`, `categories`, `post_types`), so a filter can branch on what was asked for.
Notes:
totalPostsandtotalPagesare read from the feed query itself, so they always describe what the feed actually returns.- Use negative
catIDs to exclude, notcategory__not_in. They look equivalent and are not: WordPress resolves negativecatIDs withinclude_children => true, so excluding a parent category also excludes its children, whilecategory__not_inleaves the children in the feed. - An exclusion leaves content carrying no categories alone — pages and most custom types stay in the feed. An inclusive filter (
category_name,category__in, positivecatIDs) drops them, and<askmybrand:contentTypes>reflects that. post_status,has_passwordand the noindex / “Hide from Ask My Brand” exclusions are re-applied after the filter and cannot be overridden. This feed transmits content to a third party, so no filter gets to widen it past published, unprotected content the site is willing to have indexed. Ameta_queryyou set is kept and combined with these exclusions.pagedandper_pageare not filterable: they are the URL’s pagination contract, not a statement about which content the feed carries.- The filter runs once per request. The channel metadata (
contentTypes,categories) is read from the query that actually ran, so it always describes the items. - Categories excluded in Settings Ask My Brand (and their children) are enforced after the filter and cannot be overridden — not by your own
cat, nor by atax_querywith anORrelation. - A
tax_queryyou set is kept as one nested group, so itsrelationapplies among its own clauses only. Thecategoryparameter (and anycategory_nameorcatyou set) is ANDed with it, not added as one moreORalternative.