Shorten URL with Delayed Redirect
Create shortened URLs with customizable delayed redirects and countdown timers
by Sagor Chowdhuri · github.com/sagorpi/shorten-url-wordpress-plugin · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sagorpi/shorten-url-wordpress-plugin/archive/refs/heads/main.zipShorten URL with Delayed Redirect - WordPress Plugin
A WordPress plugin that allows you to create shortened URLs with customizable delayed redirects and countdown timers.
Features
- URL Shortening: Create shortened URLs that map to longer destination URLs
- Delayed Redirect: Redirect visitors after a customizable delay (0-60 seconds)
- Countdown Timer: Visual countdown timer showing remaining seconds
- Customizable Content: Each shortened URL can have:
- Custom page title
- Meta description for SEO
- Featured image
- Static "Soon...." heading
- Click Tracking: Track the number of clicks for each shortened URL
- Easy Management: User-friendly admin interface to create and manage URLs
Installation
Method 1: Install from Git Repository (Recommended)
Using Git Updater Plugin:
- Install the Git Updater plugin
- Go to Plugins → Add New → Git Updater Install
- Enter repository URL:
https://github.com/sagorpi/shorten-url-wordpress-plugin - Click Install and Activate
Using WP-CLI:
wp plugin install https://github.com/sagorpi/shorten-url-wordpress-plugin/archive/refs/heads/main.zip --activate
Using Git Clone:
cd wp-content/plugins
git clone https://github.com/sagorpi/shorten-url-wordpress-plugin.git
wp plugin activate shorten-url-wordpress-plugin
Using Composer:
composer require sagorpi/shorten-url-redirect:dev-main
📖 For detailed Git installation instructions, see GIT-INSTALLATION.md
Method 2: Manual Installation
- Download or clone this repository
- Copy the entire
shorten-url-wordpress-pluginfolder to your WordPress plugins directory:/wp-content/plugins/ - Log in to your WordPress admin panel
- Navigate to Plugins → Installed Plugins
- Find "Shorten URL with Delayed Redirect" in the list
- Click Activate
Method 3: ZIP Upload
- Download ZIP:
https://github.com/sagorpi/shorten-url-wordpress-plugin/archive/refs/heads/main.zip - Log in to your WordPress admin panel
- Navigate to Plugins → Add New
- Click Upload Plugin
- Choose the ZIP file and click Install Now
- Click Activate Plugin
Usage
Creating a Shortened URL
- In WordPress admin, go to Short URLs → Add New
- Fill in the required fields:
- Short Code: Unique identifier for your URL (e.g., "promo2024")
- Destination URL: Where visitors will be redirected
- Redirect Delay: Number of seconds to wait (0-60)
- Page Title: Title for the redirect page
- Meta Description: (Optional) SEO description
- Featured Image: (Optional) Upload an image to display
- Click Create Shortened URL
Managing URLs
- View all shortened URLs: Short URLs menu
- Edit a URL: Click Edit next to any URL in the list
- Delete a URL: Click Delete (with confirmation)
- Track clicks: View the Clicks column in the URL list
Accessing Shortened URLs
Your shortened URLs will be in this format:
https://yoursite.com/go/your-short-code
For example, if your short code is "promo2024":
https://yoursite.com/go/promo2024
Testing the Plugin
Test 1: Create a Basic Shortened URL
- Go to Short URLs → Add New
- Enter the following:
- Short Code:
test - Destination URL:
https://wordpress.org - Redirect Delay:
5 - Page Title:
Test Redirect
- Short Code:
- Click Create Shortened URL
- Visit
https://yoursite.com/go/testin your browser - You should see a countdown from 5 seconds, then be redirected to WordPress.org
Test 2: Create URL with Image
- Create another shortened URL with an image
- Upload a featured image
- Visit the shortened URL
- Verify the image displays correctly on the redirect page
Test 3: Verify Click Tracking
- Visit a shortened URL multiple times
- Go to Short URLs in admin
- Check that the click count increases
File Structure
shorten-url-wordpress-plugin/
├── shorten-url-redirect.php # Main plugin file
├── composer.json # Composer configuration
├── .gitignore # Git ignore rules
├── README.md # Main documentation
├── GIT-INSTALLATION.md # Git installation guide
├── SETUP-GIT-REPOSITORY.md # Repository setup guide
├── QUICK-INSTALL.md # Quick install reference
├── includes/
│ ├── class-sur-database.php # Database operations
│ ├── class-sur-admin.php # Admin interface
│ └── class-sur-redirect.php # Redirect handler
├── templates/
│ ├── admin-list.php # URL list page
│ ├── admin-add-edit.php # Add/edit form
│ └── redirect-page.php # Redirect countdown page
└── assets/
├── css/
│ ├── admin.css # Admin styles
│ └── frontend.css # Redirect page styles
└── js/
├── admin.js # Admin JavaScript
└── frontend.js # Frontend JavaScript
Requirements
- WordPress 5.0 or higher
- PHP 7.0 or higher
- MySQL 5.6 or higher
Troubleshooting
Shortened URLs return 404 errors
- Go to Settings → Permalinks
- Click Save Changes (this flushes the rewrite rules)
- Try accessing your shortened URL again
Images not uploading
- Check that your WordPress media upload directory has proper write permissions
- Verify your PHP upload_max_filesize setting is adequate
Countdown not working
- Check that JavaScript is enabled in your browser
- Check browser console for any JavaScript errors
Security Features
- Nonce verification for all form submissions
- Capability checks (only administrators can manage URLs)
- Input sanitization and validation
- SQL injection prevention using prepared statements
- XSS protection through proper escaping
Support
For issues, questions, or contributions, please contact the plugin author.
License
This plugin is licensed under the GPL v2 or later.
Changelog
Version 1.0.0
- Initial release
- URL shortening functionality
- Delayed redirect with countdown timer
- Customizable page content
- Click tracking
- Admin interface