AI Verified

Name

redirect user to a page

About

This will redirect a user to any page after 10 sec.

Language

PHP

Rating

Voted: 2 by 2 user(s)

How to Setup Snippet

Change the http://example.com to the url you want to redirect to. This can be placed anywhere inside the page editor as a shortcode! You can change the time limit to more than 10 sec, but do not go less than 10 sec. It seem to start doing a load loop. This might because of caching plugins. Place this short code in any page in a short code block. [redirect_after_10_seconds]

Codevault

e6web-codes

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

04/07/2024

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

redirect user to a page

 
                    
1/*
2Plugin Name: Redirect After 10 Seconds
3Plugin URI: https://www.e6web.com
4Description: Redirects a user after 10 seconds on a page using a shortcode.
5Version: 1.0
6Author: E6Web
7Author URI: https://www.E6Web.com
8*/
9 
10// Define the shortcode and its callback function
11function redirect_after_10_seconds_shortcode() {
12// Add the JavaScript code to the page
13return '<script>setTimeout(function() { window.location.href = "http://example.com"; }, 10000);</script>';
14}
15add_shortcode( 'redirect_after_10_seconds', 'redirect_after_10_seconds_shortcode' );

2

Related Snippets

Please see some snippets below related to this snippet..

General

AI Verified

0

Disable Admin Bar for All Users Except Admins

Added: 7 months ago

Last Updated: 3 days ago

General

AI Verified

1

Add content after a menu in mobile version (bricks builder)

Added: 1 year ago

Last Updated: 11 months ago

Add content after wordpress defaut menu in mobile version (here)

General

Unverified

0

mediaPlayer

Added: 2 months ago

Last Updated: 2 months ago

Chippi Chippi SDP Interlude Softcore

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

AI Verified

2

redirect user to a page

Added: 1 year ago

Last Updated: 3 days ago

This will redirect a user to any page after 10 sec.

General

AI Verified

0

How to display a login username name on a page or post.

Added: 11 months ago

Last Updated: 11 months ago

Here is a freebie. I wanted to show a username on a page or post after they are login. Mostly as a special thanks to them for signing up. This code works with code snippet and create a short code to b...