8.12 [lcw_redirect]
[this is a free feature]
The [lcw_redirect] shortcode allows you to redirect users to a site-relative URL after an optional delay. You can also display custom content during the wait time.
🔧 Shortcode Usage
[lcw_redirect url="/thank-you" delay="5" target="_self"]
Please wait 5 seconds... redirecting.
[/lcw_redirect]🧩 Attributes
url
string
(Required) Relative URL path (e.g., /thank-you). don't use the full url like http://mydomain.com/thank-you
delay
int
Delay in seconds before the redirection happens. Default: 0 (instant redirect).
target
string
Where to open the link: _self, _blank, _parent, or _top. Default: _self.
💡 Features
✅ Site-relative URL: Automatically prepends your WordPress site's home URL to the
urlattribute.💬 Custom Content: Shows a message or HTML while waiting for the redirect.
⏱️ Delay: Uses a delay for the redirect.
🔀 Supports Nested Shortcodes: Works with shortcodes inside both attributes and content.
🔐 Sanitized Inputs: Ensures clean and safe output with
esc_url()andesc_attr().
🧪 Example Scenarios
Redirect after delay with message:
Immediate redirect with no message:
Redirect to open in a new tab:
⚠️ Error Handling
If
urlis empty or not provided:
Last updated