Snippet Types
| Type | Label | Auto-wrap |
|---|---|---|
html | HTML | No — raw output |
js | JavaScript | Wraps in <script>…</script> unless already present |
css | CSS | Wraps in <style>…</style> unless already present |
Type drives syntax highlighting and auto-wrap logic. It does not change where the snippet fires — that is Location.
Injection Locations
| Location key | WordPress hook | Notes |
|---|---|---|
head | wp_head (priority 1) | Analytics, tracking pixels, preconnect |
before_content | the_content filter | Singular templates only |
after_content | the_content filter | Singular templates only |
footer | wp_footer (priority 1) | Chat widgets, deferred scripts |
If a theme bypasses the_content, OCodeInsert fires a JS fallback via wp_footer that targets the article body.
Page Type Targeting
| Value | Matches |
|---|---|
all | Every page (default) |
front | is_front_page() |
single | is_singular() |
archive | Category, tag, date archives + blog index |
search | is_search() |
404 | is_404() |
URL Pattern Targeting
Comma-separated URL paths relative to the domain root. Use * as a wildcard. Case-insensitive; trailing slashes ignored.
/about, /blog/*, /shop/product-category/*
User Condition
| Value | Behavior |
|---|---|
all | All visitors (default) |
logged_in | Logged-in users only |
logged_out | Logged-out visitors only |
Check order
All conditions must pass for a snippet to fire:
- Plugin globally enabled?
- Safe Mode active?
?oci_safe=1in URL?- Page type passes?
- User condition passes?
- URL pattern passes?
- Snippet is
active?
