How can I remove the hyperlink to posts on the edit.php screen when listing all posts?
I am already removing the on hover links using the code below, but I want the actual post titles not to be hyperlinked at all.
add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions( $actions )
{
if( get_post_type() === 'wprss_feed_item' )
unset( $actions['edit'] );
unset( $actions['view'] );
unset( $actions['trash'] );
unset( $actions['inline hide-if-no-js'] );
return $actions;
}
I also tried adding a column instead of the title column, and then echoing get_the_title() within that column. However in that case, although I would get rid of the hyperlink, I would lose the WP functionality that adds the quick links for trashing, editing etc. beneath the post title.
I also tried the following with no success:
add_filter( 'edit_post_link', 'remove_hyperlink_from_food_titles');
function remove_hyperlink_from_food_titles() {
if ( 'edit-food_item' !== get_current_screen()->id )
return;
return get_the_title();
}
You can remove the a tag with javascript, short and easy.
Use the follow plugin; include a small script in the footer of the
edit.php
, only this page in backend of WP and remove all a-tag inside the table; see the selector on the source below.The result:
All you’re searching for is right inside
~/wp-admin/includes/screen.php
.We even got a tag for it: screen-columns.
If you can’t around it, you can still use a silly solution. Replace the link with
#
and change the CSS styles.