Use an "Archived" status to unpublish content without having to trash it.
This plugin allows you to archive your WordPress content similar to the way you archive your e-mail.
Over 13 languages supported
Did you find this plugin helpful? Please consider leaving a 5-star review.
Development of this plugin is done on GitHub. Pull requests welcome. Please see issues reported there before going to the plugin forum.
Actually, no, they are not the same thing.
The Draft status is a “pre-published” status that is reserved for content that is still being worked on. You can still make changes to content marked as Draft, and you can preview your changes.
The Private status is a special kind of published status. It means the content is published, but only certain logged-in users can view it.
The Archived post status, on the other hand, is meant to be a “post-published” status. Once a post has been set to Archived it can no longer be edited or viewed.
Of course, you can always change the status back to Draft or Publish if you want to be able to edit its content again.
Yes, there is nothing wong with trashing old content. And the behavior of the Archived status is very similar to that of trashing.
However, WordPress permanently deletes trashed posts after 30 days (see here).
This is what makes the Archived post status handy. You can unpublish content without having to delete it forever.
This plugin does not have a settings page. However, there are numerous hooks available in the plugin so you can customize default behaviors. Many of those hooks are listed below in this FAQ.
Archived content is by default viewable for users with the any user with the read_private_posts
capability.
This means if you are viewing your site while being logged in as an Editor or Administrator, you will see the archived content. However, lower user roles and non-logged-in users will not see the archived content.
You can change the default read capability by adding this hook to your theme’s functions.php
file or as an MU plugin:
function my_aps_default_read_capability( $capability ) { $capability = 'read'; return $capability; } add_filter( 'aps_default_read_capability', 'my_aps_default_read_capability' );
Add these hooks to your theme’s functions.php
file or as an MU plugin:
add_filter( 'aps_status_arg_public', '__return_true' ); add_filter( 'aps_status_arg_private', '__return_false' ); add_filter( 'aps_status_arg_exclude_from_search', '__return_false' );
You can change the post status name, the “Archived” string, by adding the code snippet to your theme’s functions.php
file or as an MU plugin:
add_filter( 'aps_archived_label_string', function( $label ) { $label = 'Custom Label'; // replace with your custom label return $label; });
This will change the name used in the admin and on the post title label (see below).
This plugin automatically adds Archived:
to the title of archived content. (Note that archived content is only viewable to logged in users with the read_private_posts
capability).
You can modify the label text, the separator, whether it appears before or after the title, or disable it entirely.
Follow the examples below, adding the code snippet to your theme’s functions.php
file or as an MU plugin.
Remove the label
add_filter( 'aps_title_label', '__return_false' );
Place the label after the title
add_filter( 'aps_title_label_before', '__return_false' );
Change the separator
The separator is the string between the “Archived” label and the post title, including spaces. When the label appears before the title, the separator is a colon and space :
, if the label is placed after the title it is a dash with spaces on each side -
.
You can customize the separator with the following filter:
add_filter( 'aps_title_separator', function( $sep ) { $sep = ' ~ '; // replace with your separator return $sep; });
filter_input
, using native WP functions for escaping & getting query var. Fixes another issue, where archived posts couldn’t be trashed (Closes #35)aps_archived_label_string
filter to modify the “Archived” string used for the label.aps_title_separator
and aps_title_label
to filter the post title prefix and separator, defaults to ‘Archived’ with a :
separator. Disable the title label entirely by using add_filter( 'aps_title_prefix', '__return_false' );
in your functions.php
file or custom plugin file. Closes #21aps_title_label_before
filter, defaults to true
– pass false
to have the label appear after the title instead of before it. This change along with the label string filter above closes #31Ownership of this plugin is being transferred to Joshua David Nelson. A huge thank you to @fjarrett for his work on this plugin to this point. More info to come soon, keep an eye on the Github Repository!
This update includes:
– Tested up to WordPress 6.4.2
– Added minimum PHP of 7.4
– Bumped minimum WordPress to 5.3
– Added Github actions for deployment to WP repo
– Updated contributors in readmes
– Added PHPStan and PHPCS Github actions
Props fjarrett
cs_CZ
.Props fjarrett
Props fjarrett, brandbrilliance
Props fjarrett
$post
is null (#6).Props fjarrett, stevethemechanic, edwin-yard
nl_NL
.the_title
filter.de_DE
, es_ES
, fr_FR
, pt_PT
and ru_RU
.read_private_posts
capability can now view Archived content.aps_excluded_post_types
filter now works as expected on Edit screens.Props fjarrett
Props fjarrett, pollyplummer
Props fjarrett