• Resolved GermanKiwi

    (@germankiwi)


    Hi there,
    I’m looking for a simple way to remove the “Archived:” prefix from the title of archived posts/pages.

    As you may know, pages/posts marked as Private also add a “Private:” prefix to their titles, similar to what your plugin does. And currently I use a handy function to remove that prefix from the Private pages, which uses the “private_title_format” filter, as follows:

    function private_title_remove_prefix( $format ) {
    	return '%s';
    }
    add_filter( 'private_title_format', 'private_title_remove_prefix' );

    I wonder if your plugin has a similar filter to “private_title_format” which I could use to create a similar function to the one above?

    If not, would you consider adding such a filter? It would be practical if your plugin worked in a similar way as this, for consistency. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Frankie Jarrett

    (@fjarrett)

    The plugin simply uses the core the_title filter. So you should just be able to remove the filter added by the plugin from an earlier hook.

    Untested example:

    add_action( 'init', function () {
        remove_filter( 'the_title', 'aps_the_title' );
    } );
    
    Thread Starter GermanKiwi

    (@germankiwi)

    That works a charm – thanks! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Function for removing Archive prefix from title’ is closed to new replies.