Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 219|回复: 0

Eliminating Unnecessary WordPress Dashboard Widgets

[复制链接]

1

主题

1

帖子

5

积分

新手上路

积分
5
发表于 2024-1-25 13:09:53 | 显示全部楼层 |阅读模式

Once you log in to your WordPress dashboard, you will notice a couple of sections (widgets) such as At a Glance, Site Stats, Quick Draft, and WordPress News among others. Most of these dashboard widgets are added by WordPress, but the number of widgets displayed could go up or down depending on your theme and/or plugins. Some themes and plugins add their own widgets to the dashboard.


While some of these widgets are useful, do your clients need to see each? Do you need to see each of these Country Email List widgets every time you log in? Perhaps you had to put up with the widgets because you had no way of getting rid of them. Today is your lucky day. You can easily remove as many dashboard widgets as you wish using a few lines of code:

Copying the above code in your child theme’s functions.php file (found at wp-content/themes/yourthemename/child-theme/functions.php) and saving the changes will eliminate all dashboard widgets with the exception of those added by your theme or plugins. From the code above, all users with less than admin capabilities won’t see the widgets thanks to this part of the code.





which checks if the user has (‘manage_options’) capability only available to administrators. Perhaps you don’t want to rid your dashboard of all widgets. You can use the following code instead:

Copy the above code to your functions.php file and save changes to get rid of the Quick Draft widget. To remove any other widget, just replace ‘dashboard_quick_press’, ‘dashboard’, ‘side’ with corresponding slug for each widget. Other standard widget slugs include.

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2024-9-22 17:17 , Processed in 0.046875 second(s), 19 queries .

Powered by Discuz! X3.5

Copyright © 2001-2022 Tencent Cloud.

快速回复 返回顶部 返回列表