必备的实用WordPress插件推荐,提升你的站点性能!

我的WordPress插件宝藏清单大公开

下面是我平时用的WordPress插件列表,大家可以参考一下哦:

1、谷歌分析

google-analyticator

Google Analytics Counter

(这两者的区别在于,Counter可以单独查看页面分析,而analyticator只能在仪表盘上看到数据)

2、清理插件

数据库优化工具:wp-clean-up

图片清理工具:dnui-delete-not-used-image-wordpress

另外还有:image-cleanup

以及:image-regenerate-select-crop.3.3

还有上传的附件清理:cuf-cleanup-upload-folder(这个插件有点模糊,但当初收藏的时候觉得不错)

3、图片灯箱(适合展示幻灯片和轮换)

图片灯箱插件:image-zoom

还有:add-highslide

以及:auto-highslide

4、保存远程图片到本地

图片保存工具:auto-save-image

还有:auto-upload-images

以及:dx-auto-save-images

还有:hacklog-remote-image-autosave

最后一个:qqworld-auto-save-images

5、快速置顶插件:sm-sticky-clicky-star

6、内链生成工具:rejected-wp-keyword-link-rejected

7、批量创建分类:batch-category-import(可以和WP的分类转标签一起使用,轻松批量创建标签)

8、站内搜索统计工具:search-meter

9、浏览统计插件:wp-postviews

10、网站地图生成器:baidu-sitemap-generator

11、删除重复文章的工具:delete-duplicate-posts

12、批量删除文章:bulk-delete(例如,可以删除某个分类或者标签下的所有文章)

为了避免一些主题不兼容或产生冲突,所以我特意收藏了几款重复的插件备用。

——————————————————————————————————————

顺便分享一些在functions.php文件中常用的代码,大家可以参考一下:

// 去掉头部冗余代码
remove_action( 'wp_head', 'wp_generator' );// WP版本信息
remove_action( 'wp_head', 'rsd_link' );remove_action( 'wp_head', 'wlwmanifest_link' );// 同上
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );// 上下文章的链接
remove_action( 'wp_head', 'feed_links', 2 );remove_action( 'wp_head', 'feed_links_extra', 3 );remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );// 短链接

// 禁用前台自动加载的表情脚本
// 来源于Disable Emojis插件:Disable Emojis
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );
/**
* 过滤函数,用于去除tinymce的emoji插件。
*/
function disable_emojis_tinymce( $plugins ) {
return array_diff( $plugins, array( 'wpemoji' ) );
}

// 上传图片时自动重新命名
function huilang_wp_handle_upload_prefilter($file){
$time=date("YmdHis");
$file['name'] = $time."." . pathinfo($file['name'], PATHINFO_EXTENSION);
return $file;
}
add_filter('wp_handle_upload_prefilter', 'huilang_wp_handle_upload_prefilter');

// 后台禁用Google Open Sans字体(这个在墙内特别重要)
function wpdx_disable_open_sans( $translations, $text, $context, $domain ) {
  if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
    $translations = 'off';
  }
  return $translations;
}
add_filter( 'gettext_with_context', 'wpdx_disable_open_sans', 888, 4 );

// 开启链接管理按钮
add_filter( 'pre_option_link_manager_enabled', '__return_true');

// 开启特色图片功能
if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
}

add_filter('mce_buttons','single_page_editor');  
function single_page_editor($mce_buttons) {
    $pos = array_search('wp_more',$mce_buttons,true);
    if ($pos !== false) {
        $tmp_buttons = array_slice($mce_buttons, 0, $pos+1);
        $tmp_buttons[] = 'wp_page';
        $mce_buttons = array_merge($tmp_buttons, array_slice($mce_buttons, $pos+1));
    }
    return $mce_buttons;
}

让你的后台文章列表更精彩:添加缩略图

// 在后台展示文章列表时加入缩略图
if ( !function_exists('fb_AddThumbColumn') && function_exists('add_theme_support') ) {
// 为文章和页面启用缩略图功能
add_theme_support('post-thumbnails', array( 'post', 'page' ) );

function fb_AddThumbColumn($cols) {
$cols['thumbnail'] = __('缩略图');
return $cols;
}

function fb_AddThumbValue($column_name, $post_id) {
$width = (int) 80; // 设置缩略图宽度
$height = (int) 80; // 设置缩略图高度

if ( 'thumbnail' == $column_name ) {
// 获取文章缩略图ID
$thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );
// 获取文章的图片附件
$attachments = get_children( array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image') );

if ($thumbnail_id) {
$thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true );
} elseif ($attachments) {
foreach ( $attachments as $attachment_id => $attachment ) {
$thumb = wp_get_attachment_image( $attachment_id, array($width, $height), true );
}
}

if ( isset($thumb) && $thumb ) {
echo $thumb; // 输出缩略图
} else {
echo __('无'); // 没有缩略图时显示“无”
}
}
}

// 为文章列表添加缩略图列
add_filter( 'manage_posts_columns', 'fb_AddThumbColumn' );
add_action( 'manage_posts_custom_column', 'fb_AddThumbValue', 10, 2 );

// 为页面列表添加缩略图列
add_filter( 'manage_pages_columns', 'fb_AddThumbColumn' );
add_action( 'manage_pages_custom_column', 'fb_AddThumbValue', 10, 2 );
}
来源:知乎
原文标题:有哪些实用的WordPress 插件值得推荐? – 知乎用户UyqOMT 的回答
声明:
文章来自网络收集后经过ai改写发布,如不小心侵犯了您的权益,请联系本站删除,给您带来困扰,深表歉意!

本文标题:必备的实用WordPress插件推荐,提升你的站点性能!
网址:https://www.2090ai.com/2025/11/06/plugins/65546.html



本站所有文章由wordpress极光ai post插件通过chatgpt写作修改后发布,并不代表本站的观点;如果无意间侵犯了你的权益,请联系我们进行删除处理。
如需转载,请务必注明文章来源和链接,谢谢您的支持与鼓励!