Textport
A very slim plugin that allows downloading of post (or page, if you tweak the code) content via TXT, HTML, and MD formats.
by Ryan T. M. Reiffenberger · github.com/reclaimergold/textport · 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/reclaimergold/textport/archive/refs/heads/main.zipAdds buttons to the WordPress post edit screen allowing users to download the post content in .txt, .html, or .md (Markdown) formats.
Description
Textport is a utility plugin designed for WordPress content creators and administrators. It seamlessly integrates into the post editing interface, providing convenient one-click buttons to download the current post's content in three different formats:
-
.TXT: A plain text version of your post content, with all HTML tags stripped out. Useful for simple text backups or repurposing content where formatting is not needed.
-
.HTML: The full HTML rendered version of your post content, as it would typically appear on the front end of your website. This includes processed shortcodes and WordPress auto-formatting (like
<p>tags). -
MARKDOWN (.MD): A Markdown representation of your post content. This is generated by converting the rendered HTML to Markdown, suitable for use in Markdown-based systems or for easier plain-text editing with formatting cues.
This plugin is ideal for:
-
Quickly backing up individual posts.
-
Exporting content for use in other systems or platforms.
-
Providing authors with easy access to different formats of their work.
Installation
-
Download: Download the
textport.zipfile (if you package it) or clone the repository. -
Upload:
-
If you have a
.zipfile: In your WordPress admin panel, go toPlugins>Add New. ClickUpload Pluginand choose thetextport.zipfile. -
If you have the plugin folder: Upload the
textportfolder to the/wp-content/plugins/directory on your server.
-
-
Activate: Go to the
Pluginspage in your WordPress admin panel and clickActivatefor the "Textport" plugin.
Usage
Once activated, the Textport plugin adds a new meta box titled "Download Content (Textport)" to the sidebar of the post editing screen (for the "Post" post type by default).
Within this meta box, you will find three buttons:
-
Download as .TXT: Click this button to download a
.txtfile containing the HTML-stripped plain text of the current post. -
Download as .HTML: Click this button to download an
.htmlfile containing the rendered HTML of the current post. -
Download as MARKDOWN: Click this button to download an
.mdfile containing a Markdown version of the current post.
The downloaded file will be named using the post title (e.g., textport-your-post-title.txt) or textport-post-{ID}.txt if the title is empty.
Notes
-
Markdown Conversion: The HTML to Markdown conversion is a basic implementation suitable for common HTML structures. For highly complex HTML or very specific Markdown requirements, the output may need manual adjustments. More advanced Markdown conversion could be achieved by integrating a dedicated PHP Markdown library.
-
Post Types: By default, the download buttons appear only on the "Post" post type edit screen. The plugin code includes commented-out lines that can be enabled to add this functionality to "Pages" or other custom post types.
-
Permissions: Only users with the capability to
edit_postfor a specific post will be able to see and use the download buttons for that post.
Frequently Asked Questions
-
Can I add this to other post types (e.g., Pages, Custom Post Types)? Yes, you can modify the
textport_add_meta_box()function intextport.phpto include other post types. Look for the commented-outadd_actionoradd_meta_boxlines as examples. -
Is the Markdown conversion perfect? The current Markdown conversion is basic and handles common HTML elements. For very complex HTML, the result might not be perfect. If you require highly accurate Markdown, consider extending the plugin with a more robust HTML-to-Markdown PHP library.