Replace Dashes Before Title in Page List

You can’t change dashes using any filter because there is no filter available to change it.

but still you can change this using jQuery put this code inside functions.php

add_action('admin_head',function(){


global $pagenow;

// check current page.
if( $pagenow == 'edit.php' ){ ?>

    <script>

        jQuery(function($){

            var post_title = $('.wp-list-table').find('a.row-title');
            $.each(post_title,function(index,em){
                var text = $(em).html();
                // Replace all dashes to * 
                $(em).html(text.replace(/—/g ,'*'));
            });
        });

    </script>
    <?php
    }
});

See https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-posts-list-table.php#L918-L919

Leave a Comment