Title: Remove the &quot;Permalink&quot; action on P2 posts
Last modified: August 21, 2016

---

# Remove the "Permalink" action on P2 posts

 *  [Mathias](https://wordpress.org/support/users/stoupoun/)
 * (@stoupoun)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/remove-the-permalink-action-on-p2-posts/)
 * Hi there,
 * I am customizing P2 as a child theme for my own private internal chatroom, and
   there are 2 things I want to do:
 * 1. Remove the tag count between brackets on the posts.
    2. Remove the “Permalink”
   action link (next to “Reply | Edit”) on posts and comments, which I find pretty
   useless.
 * For #1, I normally just go inside the functions.php get_tags_with_count and replace:
 * `$tag_link = '<a href="' . get_tag_link( $tag ) . '" rel="tag">' . $tag->name.'('.
   number_format_i18n( $tag->count ) . ' )</a>';`
 * by
 * `$tag_link = '<a href="' . get_tag_link( $tag ) . '" rel="tag">' . $tag->name.'
   </a>';`
 * Is there a better/cleaner way to do that without having to make that change every
   time P2 gets updated?
 * For #2, the problem seems more complicated… I’ve done some Googling and it seems
   I may have to not only edit functions.php but also some other files. My first
   attempt seems to have made a mess as when I use the Search box on my site it 
   now displays the search result in complete random order (as opposed to chronological).
 * Any help and suggestions appreciated!
 * Thanks in advance,
    Mathias
 * [https://wordpress.org/themes/p2/](https://wordpress.org/themes/p2/)

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

 *  [Sheri Grey](https://wordpress.org/support/users/designsimply/)
 * (@designsimply)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/remove-the-permalink-action-on-p2-posts/#post-5089413)
 * Try adding the following to your child theme’s functions.php file to see if it
   does the trick:
 *     ```
       add_action( 'tags_with_count', 'tags_without_count', 10, 3);
       function tags_without_count( $post, $format = 'list', $before = '', $sep = '', $after = '' ) {
               global $post;
               $posttags = get_the_tags($post->ID, 'post_tag' );
   
               if ( !$posttags )
                       return ''; 
   
               foreach ( $posttags as $tag ) {
                       if ( $tag->count > 1 && !is_tag($tag->slug) ) {
                               $tag_link = '<a href="' . get_tag_link( $tag ) . '" rel="tag">' . $tag->name . '</a>';
                       } else {
                               $tag_link = $tag->name;
                       }    
   
                       if ( $format == 'list' )
                               $tag_link = '<li>' . $tag_link . '</li>';
   
                       $tag_links[] = $tag_link;
               }    
   
               return '<br>Tags: ' . implode( ', ', $tag_links);
       }
       ```
   
 *  Thread Starter [Mathias](https://wordpress.org/support/users/stoupoun/)
 * (@stoupoun)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/remove-the-permalink-action-on-p2-posts/#post-5089422)
 * That looks very similar to what I was doing hacking the original P2 functions.
   php, so thanks for the proper way to do it via the child theme!
 * Now, has anybody got any ideas for #2?
 *  [Sheri Grey](https://wordpress.org/support/users/designsimply/)
 * (@designsimply)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/remove-the-permalink-action-on-p2-posts/#post-5089426)
 * > 2. Remove the “Permalink” action link (next to “Reply | Edit”) on posts and
   > comments, which I find pretty useless.
 * You could simply hide the link using custom CSS. Here is an example that might
   work for you:
 *     ```
       .actions {
       	visibility: hidden;
       }
       .actions a {
       	visibility: visible;
       }
       .thepermalink {
       	display: none;
       }
       ```
   

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

The topic ‘Remove the "Permalink" action on P2 posts’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/p2/1.5.8/screenshot.png)
 * P2
 * [Support Threads](https://wordpress.org/support/theme/p2/)
 * [Active Topics](https://wordpress.org/support/theme/p2/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/p2/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/p2/reviews/)

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [tag count](https://wordpress.org/support/topic-tag/tag-count/)

 * 3 replies
 * 2 participants
 * Last reply from: [Sheri Grey](https://wordpress.org/support/users/designsimply/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/remove-the-permalink-action-on-p2-posts/#post-5089426)
 * Status: not resolved