Overview
Custom Extraction Rules (v0.7) let you define per-domain CSS selectors that control exactly what Web2MD extracts. If a site’s main content lives in an unusual container, or if there are elements you always want stripped, custom rules give you full control.Custom Rules is a Pro-only feature.
Creating a rule
Rule fields
| Field | Description | Example |
|---|---|---|
| Domain | The domain this rule applies to (exact match) | docs.example.com |
| Content selector | CSS selector for the main content container | article.post-body |
| Remove selectors | CSS selectors for elements to strip (comma-separated) | .ads, .sidebar, .related-posts |
| Title selector | Override automatic title detection | h1.entry-title |
Example: cleaning up a blog
Suppose you regularly convert articles from a blog that wraps content in a specific div and includes noisy sidebar widgets:- Extract only the content inside
div.article-content - Strip the author bio, newsletter signup, and comments
- Use the
h1.post-titleelement as the document title
How rules are applied
Automatic matching
Rules are matched by domain. When you convert a page, Web2MD checks if a custom rule exists for that domain and applies it before the standard extraction pipeline.
Fallback behavior
If your content selector doesn’t match anything on the page, Web2MD falls back to its default extraction logic. Your rule won’t break conversions.
Managing rules
All rules are managed in Settings → Custom Rules within the extension popup.| Action | How |
|---|---|
| Create | Settings → Custom Rules → New Rule |
| Edit | Click any existing rule to modify its selectors |
| Delete | Click the trash icon next to a rule |
| Test | Navigate to a page on the target domain and run a conversion |
Community sharing
Community rule sharing is coming soon. You’ll be able to mark rules as public (
isPublic flag) so other users can benefit from your domain-specific selectors.Relationship to Site Adapters
Custom Rules and Site Adapters serve different purposes:| Site Adapters | Custom Rules | |
|---|---|---|
| Scope | Built-in, specific platforms (Reddit, GitHub, etc.) | Any domain you define |
| Method | Uses platform APIs and specialized logic | CSS selectors only |
| Maintained by | Web2MD team | You |
| Priority | Runs first | Runs if no adapter matches |