Any Site to WordPress Widget
Convert any website page to a WordPress HTML widget instantly. Just paste a URL and get clean, sanitized HTML code ready for WordPress.
by yhajizada · github.com/yhajizada/any-site-to-wordpress-widget · 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/yhajizada/any-site-to-wordpress-widget/archive/refs/heads/main.zipReadme
Any Site to WordPress Widget
🚀 Convert any website page to a clean, sanitized WordPress HTML widget with one click.
📖 Table of Contents
- ✨ Features
- 📸 Screenshots
- 📥 Installation
- 🚀 Quick Start
- 🔧 Usage Examples
- 📋 How to Use in WordPress
- 👨💻 Developer Usage
- 🛡️ Security
- 📊 System Requirements
- 🤝 Contributing
- 📝 License
- 🙏 Acknowledgments
- 📞 Support
- ⭐ Star History
✨ Features
| Feature | Description |
|---|---|
| 🚀 One-Click Conversion | Just paste a URL and get ready-to-use HTML |
| 🧠 Smart Content Extraction | Optionally extract only the main content area |
| 🔒 Security First | All HTML is sanitized using WordPress's wp_kses |
| 🔌 WordPress Native | Works as a WordPress plugin with admin interface |
| 📋 Copy & Download | Copy to clipboard or download as HTML file |
| 👨💻 Developer Friendly | Can be used programmatically as a PHP class |
| 🆓 Free & Open Source | 100% free with GPL-2.0 license |
| 🌍 Multilingual Ready | Translation ready with WordPress i18n |
| ⚡ Lightweight | Minimal footprint, no external dependencies |
| 📱 Mobile Friendly | Works on all devices |
📸 Screenshots
Main Admin Interface

Conversion Result

Settings Page

📥 Installation
Method 1: WordPress Admin (Easiest)
- Download the latest ZIP file from Releases
- Go to WordPress Admin → Plugins → Add New
- Click the "Upload Plugin" button at the top
- Select the downloaded ZIP file and click "Install Now"
- Click "Activate"
Method 2: Manual Installation (Advanced)
# Navigate to your WordPress plugins directory
cd wp-content/plugins/
# Clone the repository
git clone https://github.com/yhajizada/any-site-to-wordpress-widget.git
# Activate the plugin via WordPress Admin
Method 3: Composer (Developers)
composer require yhajizada/any-site-to-wordpress-widget
🚀 Quick Start
- After activation, go to WordPress Admin → Site to Widget
- Enter any website URL (e.g.,
https://example.com/article-to-convert) - Click "Convert to HTML"
- Copy the generated HTML
- Paste it into your WordPress page using the Custom HTML block
That's it! Your content is now a WordPress widget. 🎉
🔧 Usage Examples
Example 1: Convert a Blog Article
URL: https://techblog.com/interesting-article
Options: ✅ Extract main content only
Result: Clean, article-only HTML ready for WordPress
Example 2: Convert a Product Page
URL: https://store.com/product-page
Options: ❌ Extract main content only
Result: Full product description, images, and details as sanitized HTML
Example 3: Convert a News Article
URL: https://news.com/latest-headline
Options: ✅ Extract main content only
Result: Article content without ads, sidebars, or navigation
📋 How to Use in WordPress
Using Gutenberg (Block Editor)
- Copy the HTML code from the plugin
- Open any WordPress page or post
- Add a "Custom HTML" block
- Paste the code
- Publish or Update the page
Using Classic Editor
- Copy the HTML code from the plugin
- Open any WordPress page or post
- Switch to "Text" tab
- Paste the code
- Publish or Update the page
Using a Widget Area
- Copy the HTML code from the plugin
- Go to WordPress Admin → Appearance → Widgets
- Add a "Text" widget to any widget area
- Paste the code
- Click "Save"
👨💻 Developer Usage
Basic Usage
// Include the class
require_once 'includes/class-url-to-widget.php';
// Create instance
$converter = new URL_to_Widget_Converter();
// Convert a URL
$html = $converter->process('https://example.com');
// Display the result
echo $html;
Advanced Usage
// Include the class
require_once 'includes/class-url-to-widget.php';
// Create instance with custom options
$converter = new URL_to_Widget_Converter();
// Convert with content extraction
$html = $converter->process('https://example.com', true);
// Check for errors
if ( false === $html ) {
echo 'Failed to fetch URL';
} else {
echo $html;
}
Custom Sanitization
// Extend the class for custom sanitization
class My_Custom_Converter extends URL_to_Widget_Converter {
public function sanitize_html( $html ) {
// Add custom tags
$allowed_tags = array_merge(
parent::get_allowed_tags(),
array(
'custom-tag' => array( 'custom-attr' => array() )
)
);
return wp_kses( $html, $allowed_tags );
}
}
🛡️ Security
This plugin uses WordPress's built-in wp_kses function for HTML sanitization.
Security Features
| Type | Status | Description |
|---|---|---|
| Safe HTML tags | ✅ Preserved | p, div, h1-h6, a, img, tables, lists |
| JavaScript | ❌ Removed | script tags and inline JS |
| Event handlers | ❌ Removed | onclick, onload, onerror, etc. |
| iFrames | ❌ Removed | iframe, embed, object |
| CSS classes | ✅ Preserved | Safe CSS classes |
| CSS styles | ✅ Preserved | Safe inline styles |
| Links | ✅ Preserved | href attributes with validation |
| Images | ✅ Preserved | src, alt, width, height |
| Meta tags | ❌ Removed | meta, link, script, style |
WordPress Security Standards
This plugin follows WordPress security best practices:
- ✅ Uses
wp_ksesfor input sanitization - ✅ Uses
wp_remote_getfor HTTP requests - ✅ Uses
esc_url_rawfor URL validation - ✅ Uses
esc_htmlfor output escaping - ✅ Uses
wp_nonce_fieldfor CSRF protection - ✅ No direct database queries
- ✅ No file system operations
📊 System Requirements
Minimum Requirements
- WordPress: 5.0 or higher
- PHP: 7.2 or higher
- Server:
allow_url_fopenor cURL enabled - Memory: 64MB minimum (128MB recommended)
Recommended Requirements
- WordPress: 6.0 or higher
- PHP: 8.0 or higher
- Server: cURL enabled with SSL support
- Memory: 128MB or higher
Server Compatibility
| Server | Status |
|---|---|
| Apache | ✅ Fully compatible |
| Nginx | ✅ Fully compatible |
| LiteSpeed | ✅ Fully compatible |
| IIS | ✅ Compatible (with PHP) |
| WP Engine | ✅ Tested and working |
| Kinsta | ✅ Tested and working |
| SiteGround | ✅ Tested and working |
| Bluehost | ✅ Tested and working |
🤝 Contributing
Contributions are welcome! Here's how you can help:
Ways to Contribute
- Report Bugs - Use the Issue Tracker
- Suggest Features - Open a feature request issue
- Write Code - Submit pull requests
- Improve Documentation - Update README or docs
- Translate - Help translate into other languages
Development Setup
# Fork the repository
# Clone your fork
git clone https://github.com/your-username/any-site-to-wordpress-widget.git
# Create a feature branch
git checkout -b feature/amazing-feature
# Make your changes
# Test your changes
# Submit a pull request
Pull Request Guidelines
- Follow WordPress Coding Standards
- Use meaningful commit messages
- Test your changes thoroughly
- Update documentation if needed
- Keep pull requests focused on a single feature
📝 License
This project is licensed under the GPL-2.0+ License.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license text: LICENSE
🙏 Acknowledgments
- WordPress Foundation - For the excellent CMS and APIs
- PHP Community - For the awesome programming language
- Open Source Community - For inspiring this project
- All Contributors - Who helped make this plugin better
Built With
- WordPress - CMS platform
- PHP - Programming language
- wp_kses - HTML sanitization
- wp_remote_get - HTTP requests
📞 Support
Documentation
Community Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Stack Overflow: Tag with
any-site-to-wordpress-widget
Commercial Support
Need priority support or custom development? Contact: [your-email@example.com]
⭐ Star History
🌟 Show Your Support
If you like this project, please give it a star ⭐ on GitHub!
📊 Statistics
Made with ❤️ by yhajizada
⭐ If you like this plugin, please give it a star on GitHub! ⭐