WP Manifestindependent plugin directory
manifest / content / textport

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

★ 0stars
0forks

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.zip

Adds 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

  1. Download: Download the textport.zip file (if you package it) or clone the repository.

  2. Upload:

    • If you have a .zip file: In your WordPress admin panel, go to Plugins > Add New. Click Upload Plugin and choose the textport.zip file.

    • If you have the plugin folder: Upload the textport folder to the /wp-content/plugins/ directory on your server.

  3. Activate: Go to the Plugins page in your WordPress admin panel and click Activate for 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 .txt file containing the HTML-stripped plain text of the current post.

  • Download as .HTML: Click this button to download an .html file containing the rendered HTML of the current post.

  • Download as MARKDOWN: Click this button to download an .md file 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_post for 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 in textport.php to include other post types. Look for the commented-out add_action or add_meta_box lines 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.