Title: Remove User Panel Links
Last modified: July 22, 2020

---

# Remove User Panel Links

 *  Resolved [itskev](https://wordpress.org/support/users/itskev/)
 * (@itskev)
 * [6 years ago](https://wordpress.org/support/topic/remove-user-panel-links/)
 * I found where the code is in the shortcodes.php and class-theme-my-login-widget.
   php to remove Dashboard and Edit My Profile links. Is there a way that I can 
   add code to the theme-my-login-custom.php file to disable them and what would
   that be? I’m not a coder, per se, but I know how to remove the proper code. I
   just don’t want an update to those plugin files to overwrite the other files.
   Thanks!
    -  This topic was modified 6 years ago by [itskev](https://wordpress.org/support/users/itskev/).

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

 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [6 years ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13157152)
 * [https://docs.thememylogin.com/article/88-modifying-the-user-panel](https://docs.thememylogin.com/article/88-modifying-the-user-panel)
 *  Thread Starter [itskev](https://wordpress.org/support/users/itskev/)
 * (@itskev)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13163351)
 * Thanks Jeff. I saw that. I’m not sure how that helps me. Instructions say “In
   order to change the links that display here, consider the following code:”
 * So I consider it. That’s it? It would be greatly helpful for the page to tell
   me more than just to consider it.
 * I tried copying that code into a custom php file and removing some of it. Is 
   that considering it? I don’t want to change the code of the two php file and 
   have them written over from an update. This is the content in the custom php 
   file. I removed the profile code from the all other roles.
 *     ```
       <?php
   
       function filter_tml_widget_user_links( $links ) {
       	$user = wp_get_current_user();
   
       	$role = reset( $user->roles );
       	if ( empty( $role ) ) {
       		$role = 'subscriber';
       	}
       	if ( is_super_admin() ) {
       		$role = 'administrator';
       	}
   
       	// These links are for authors, editors and admins
       	if ( in_array( $role, array( 'author', 'editor', 'administrator' ) ) ) {
       		$links = array(
       			'profile'   => array(
       				'title' => __( 'Profile' ),
       				'url'   => admin_url( 'profile.php' ),
       			),
       			'logout'    => array(
       				'title' => __( 'Log Out' ),
       				'url'   => wp_logout_url(),
       			),
       		);
   
       	// These are for all other roles
       	} else {
       		$links = array(
       			'logout'    => array(
       				'title' => __( 'Log Out' ),
       				'url'   => wp_logout_url(),
       			),
       		);
       	}
   
       	return $links;
       }
       add_filter( 'tml_widget_user_links', 'filter_tml_widget_user_links' );
       ```
   
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13177636)
 * You’ll want to place the code in [theme-my-login-custom.php](https://docs.thememylogin.com/article/63-using-theme-my-login-custom-php).
 *  Thread Starter [itskev](https://wordpress.org/support/users/itskev/)
 * (@itskev)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13177973)
 * Thanks Jeff. I did that, but it didn’t change anything when I took out part of
   it. I ended up taking it out of the two php files that governed it. I would rather
   use that custom php file but as of right now, it doesn’t work.
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13188133)
 * Can you confirm where you placed that file?
 *  Thread Starter [itskev](https://wordpress.org/support/users/itskev/)
 * (@itskev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13265184)
 * The file is located:
    wp-content/plugins/theme-my-login/theme-my-login-custom.
   php
 *  Thread Starter [itskev](https://wordpress.org/support/users/itskev/)
 * (@itskev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13265203)
 * Apparently, I am supposed to put this php file here:
    wp-content/plugins/
 * And that was my issue.

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

The topic ‘Remove User Panel Links’ is closed to new replies.

 * ![](https://ps.w.org/theme-my-login/assets/icon-256x256.png?rev=1891232)
 * [Theme My Login](https://wordpress.org/plugins/theme-my-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-my-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-my-login/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-my-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-my-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-my-login/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [itskev](https://wordpress.org/support/users/itskev/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/remove-user-panel-links/#post-13265203)
 * Status: resolved