Skip to main content

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

1

Open Settings

In the Web2MD popup, navigate to Settings → Custom Rules.
2

Add a new rule

Click New Rule and enter the domain (e.g., example.com).
3

Define your selectors

Set the content selector, remove selectors, and optionally a title selector.
4

Save and convert

Save the rule. Next time you convert a page on that domain, your custom selectors will be applied automatically.

Rule fields

FieldDescriptionExample
DomainThe domain this rule applies to (exact match)docs.example.com
Content selectorCSS selector for the main content containerarticle.post-body
Remove selectorsCSS selectors for elements to strip (comma-separated).ads, .sidebar, .related-posts
Title selectorOverride automatic title detectionh1.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:
Domain:           blog.example.com
Content selector: div.article-content
Remove selectors: .author-bio, .newsletter-signup, .comments-section
Title selector:   h1.post-title
With this rule, Web2MD will:
  1. Extract only the content inside div.article-content
  2. Strip the author bio, newsletter signup, and comments
  3. Use the h1.post-title element 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.
ActionHow
CreateSettings → Custom Rules → New Rule
EditClick any existing rule to modify its selectors
DeleteClick the trash icon next to a rule
TestNavigate to a page on the target domain and run a conversion
Use your browser’s DevTools (Cmd+Shift+I or F12) to inspect the page and find the right CSS selectors before creating a rule.

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 AdaptersCustom Rules
ScopeBuilt-in, specific platforms (Reddit, GitHub, etc.)Any domain you define
MethodUses platform APIs and specialized logicCSS selectors only
Maintained byWeb2MD teamYou
PriorityRuns firstRuns if no adapter matches
If a Site Adapter exists for a domain, it takes priority over custom rules. Custom rules are best for sites without a dedicated adapter.