CSS selectors tell TTSWP which parts of your post should or should not be narrated. Use them when the simpler "no-audio class" method is not enough, or when you want site-wide exclusions without editing every post.
Two types of selectors
Include selectors
By default TTSWP narrates the entire post content area. If your theme wraps the main article in a specific container (like .article-body or #main-content), you can restrict narration to just that container.
Example:
.article-body
Only text inside elements matching .article-body will be narrated. Everything outside that container is ignored.
Leave the field empty to keep the default (entire post content).
Exclude selectors
Any element matching an exclude selector is removed from the text before generation. Everything inside those elements is also removed.
Multiple selectors, one per line:
.wp-caption
figcaption
.sidebar
.widget-area
.ad-container
Common exclusion examples
Copy-paste these into your exclude list if they apply to your theme.
Image captions
.wp-caption
figcaption
.caption
Sidebars and widgets
.sidebar
#secondary
.widget-area
.elementor-sidebar
Ads
.ad-container
.advertisement
.ads
[data-ad]
.google-auto-placed
Comments
.comments-area
#comments
.comment-list
Related posts and newsletter signups
.related-posts
.yarpp-related
.mailchimp-signup
.newsletter-form
Breadcrumbs and meta info
.breadcrumbs
.post-meta
.entry-meta
.author-box
How to find the right selector
Open your post on the front-end and use your browser's inspector (F12, then click the element).
Look for:
- A class attribute (starts with
class="...") - becomes.class-name - An ID attribute (starts with
id="...") - becomes#id-name - A common tag - becomes just the tag name (
figcaption,aside)
Pick the most specific selector that still catches everything you want to exclude. If you have multiple similar elements, use a class or tag.
Testing your selectors
After saving selectors:
- Open any post with audio.
- Go to Posts → All Posts.
- Click the Regenerate icon.
- Play the new audio.
If unwanted content still appears, your selector did not match. Open your browser inspector, confirm the class or tag, and try again.
Limits
- CSS selectors run before synthesis on the raw post content
- They do not affect the visual page - only the text sent to ElevenLabs
- Complex selectors work (
.widget-area aside > .title), but keep them simple for easier maintenance