π Convert any website page to a clean, sanitized WordPress HTML widget with one click.
- β¨ Features
- πΈ Screenshots
- π₯ Installation
- π Quick Start
- π§ Usage Examples
- π How to Use in WordPress
- π¨βπ» Developer Usage
- π‘οΈ Security
- π System Requirements
- π€ Contributing
- π License
- π Acknowledgments
- π Support
- β Star History
| 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 |
- 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"
# 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 Admincomposer require yhajizada/any-site-to-wordpress-widget- 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. π
URL: https://techblog.com/interesting-article
Options: β
Extract main content only
Result: Clean, article-only HTML ready for WordPress
URL: https://store.com/product-page
Options: β Extract main content only
Result: Full product description, images, and details as sanitized HTML
URL: https://news.com/latest-headline
Options: β
Extract main content only
Result: Article content without ads, sidebars, or navigation
- 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
- 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
- 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"
// 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;// 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;
}// 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 );
}
}This plugin uses WordPress's built-in wp_kses function for HTML sanitization.
| 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 |
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
- WordPress: 5.0 or higher
- PHP: 7.2 or higher
- Server:
allow_url_fopenor cURL enabled - Memory: 64MB minimum (128MB recommended)
- WordPress: 6.0 or higher
- PHP: 8.0 or higher
- Server: cURL enabled with SSL support
- Memory: 128MB or higher
| 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 |
Contributions are welcome! Here's how you can help:
- 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
# 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- Follow WordPress Coding Standards
- Use meaningful commit messages
- Test your changes thoroughly
- Update documentation if needed
- Keep pull requests focused on a single feature
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
- 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
- WordPress - CMS platform
- PHP - Programming language
- wp_kses - HTML sanitization
- wp_remote_get - HTTP requests
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Stack Overflow: Tag with
any-site-to-wordpress-widget
Need priority support or custom development? Contact: [your-email@example.com]
If you like this project, please give it a star β on GitHub!
Made with β€οΈ by yhajizada
β If you like this plugin, please give it a star on GitHub! β


