去掉wordpress功能中的链接
ZhangPu • 2020-02-28 21:40 • 55 次点击 • 日记
在wordpress中,右侧功能部分有个wordpress的官方链接。
由于此链接早已经打不开了。(原因你懂的)

所以有很多同学想去掉这个链接。
下面分享一下方法:
拿最新的wordpress5.3.2来说,用FTP连接你的主机,打开根目录,
找到wp-includes文件夹,
在此目录下找到widgets文件夹,
这个目录下有个class-wp-widget-meta.php文件,就是我们要修改的文件。
下载到本地后用编辑器打开,
大概在61行。

删除以下代码即可
<?php
/**
* Filters the "WordPress.org" list item HTML in the Meta widget.
*
* @since 3.6.0
* @since 4.9.0 Added the `$instance` parameter.
*
* @param string $html Default HTML for the WordPress.org list item.
* @param array $instance Array of settings for the current widget.
*/
echo apply_filters(
'widget_meta_poweredby',
sprintf(
'<li><a href="%1$s">%2$s</a></li>',
esc_url( __( 'https://wordpress.org/' ) ),
__( 'WordPress.org' )
),
$instance
);
wp_meta();
?>保存文件,上传替换源文件。
然后刷新你的网页,
