External Content Block is a WordPress Gutenberg block plugin that fetches and displays content from any external URL. Simply add the block, enter a URL, and the content will be loaded server-side and displayed on your site.
Key Features:
- Easy-to-use block interface with real-time URL validation
- Configurable HTML sanitization (strict by default, or raw HTML output)
- Customizable timeout (1-60 seconds) and WordPress transients caching support
- Enhanced security with URL validation and error handling
- Works with any WordPress theme
Important: Content is loaded server-side using PHP, which means the source URL is not visible to end users, requests originate from your WordPress server's IP address (useful for IP-based authentication), and currently only GET requests are supported.
- Download or clone this repository
- Upload the
external-content-blockfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Start using the "URL Block" in the Gutenberg editor
- In the Gutenberg editor, click the "+" button to add a new block
- Search for "URL Block" or find it in the "Widgets" category
- Enter the URL you want to load content from
- Configure the block settings:
- URL: The full URL of the content you want to display (e.g.,
https://example.com/content) - Sanitize HTML (default: enabled): When enabled, HTML is sanitized using
wp_kses_post()for security. When disabled, content is injected exactly as received (including scripts and all HTML tags).⚠️ Warning: Only disable if you trust the source URL. - Timeout (seconds) (default: 5, range: 1-60): Maximum time to wait for the request to complete. If exceeded, an error will be displayed.
- Cache TTL (seconds) (default: 0, range: 0-86400): When set to a value greater than 0, content is cached using WordPress transients. Set to 0 to disable caching. Examples:
3600= 1 hour,86400= 24 hours.
- URL: The full URL of the content you want to display (e.g.,
- The content will be displayed on the frontend of your site
- WordPress 5.0 or higher (Gutenberg editor)
- PHP 7.0 or higher
Matías Roldán
- GitHub: @roldan
This plugin is licensed under the GPLv2 or later.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.