移动端禁用用户复制_如何为移动用户禁用特定的WordPress插件

移动端禁用用户复制

Recently one of our readers asked if it is possible to disable specific WordPress plugins on the mobile version of their website? Like with anything in WordPress, there’s a plugin for that. In this article, we will show you how to easily disable specific WordPress plugins in mobile version of your site.

最近,我们的一位读者问是否可以在其网站的移动版本上禁用特定的WordPress插件? 像WordPress中的任何东西一样,有一个插件。 在本文中,我们将向您展示如何在网站的移动版本中轻松禁用特定的WordPress插件。

Disable specific WordPress plugins in mobile
为什么要为移动用户禁用特定的WordPress插件 (Why Disable Specific WordPress Plugins for Mobile Users)

WordPress does not load inactive plugins when someone visits your website. However, it does loads all the active plugins and then depending on a plugin it will load required scripts and stylesheets as well.

当有人访问您的网站时,WordPress不会加载不活动的插件 。 但是,它确实会加载所有活动的插件,然后根据插件,它也会加载所需的脚本和样式表。

See our guide on how WordPress works for a behind the scene look at how it loads plugins.

请参阅有关WordPress工作原理的指南,了解其如何加载插件。

All good WordPress plugins try to only load when needed. However, sometimes it is difficult for plugin authors to guess whether you will need the plugin or not. In such situations, they opt to load the required files just in case.

所有好的WordPress插件都尝试仅在需要时加载。 但是,有时插件作者很难猜测您是否需要该插件。 在这种情况下,他们选择加载所需的文件以防万一。

Some users who want to get a perfect score in the Google speed and performance test, often want to disable specific plugins for mobile.

一些想要在Google 速度和性能测试中获得满分的用户,经常想禁用特定的移动插件。

That’s where this article can help.

这就是本文可以提供帮助的地方。

Let’s take a look at how to easily disable individual WordPress plugins for mobile version of your website.

让我们看一下如何轻松地为网站的移动版本禁用单个WordPress插件。

设置WordPress插件管理器插件 (Setting up WordPress Plugin Organizer Plugin)

First thing you need to do is install and activate the Plugin Organizer plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活Plugin Organizer插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Important: Plugin organizer is a very powerful plugin. Reordering or disabling plugins can cause conflicts and unexpected behavior which could make your site inaccessible. We recommend that you create a complete WordPress backup before disabling or reordering any plugins.

重要提示:插件管理器是一个非常强大的插件。 重新排序或禁用插件可能会导致冲突和意外行为,从而使您的网站无法访问。 我们建议您在禁用或重新排序任何插件之前创建一个完整的WordPress备份

Upon activation, you need to visit Plugin Organizer » Settings page to configure plugin settings.

激活后,您需要访问Plugin Organizer»设置页面以配置插件设置。

Apart from default options, right now you just need to turn on the following options.

除了默认选项之外,现在您只需要打开以下选项。

  • Selective plugin loading

    选择性插件加载
  • Selective mobile plugin loading

    选择性移动插件加载

Don’t forget to click on the ‘Save Settings’ button to store your changes.

不要忘记单击“保存设置”按钮来存储您的更改。

为插件管理器创建必备插件 (Creating a Must-Use Plugin for Plugin Organizer)

Plugin Organizer needs a must-use plugin to work properly. It will automatically try to create it for you, but if it fails, then you will have to create it on your own.

插件管理器需要一个必须使用的插件才能正常工作。 它会自动尝试为您创建它,但是如果失败,则您必须自己创建它。

Let’s start by checking if the plugin was able to create the MU plugin automatically.

让我们首先检查插件是否能够自动创建MU插件。

You can do this by going to the Plugins » Installed Plugins page. You will see a new link labeled Must-Use and clicking on it will show you the installed MU plugins on your site.

您可以转到“ 插件»已安装插件”页面来完成此操作。 您将看到一个标记为“必须使用”的新链接,单击该链接将向您显示您站点上已安装的MU插件。

Must use plugin installed

If you don’t see the plugin or Must-Use plugins link, then this means that the plugin organizer failed to create the file, and you will need to manually do it yourself.

如果没有看到插件或“必须使用的插件”链接,则意味着插件组织者无法创建文件,您需要自己手动进行操作。

First, you need to connect to your website using an FTP client or File Manager app in cPanel.

首先,您需要使用 cPanel中的FTP客户端或文件管理器应用程序连接到您的网站。

Next, you need to go to the /wp-content/mu-plugins/ folder. If you don’t have a mu-plugins folder in your /wp-content/ folder, then you need to create one.

接下来,您需要转到/ wp-content / mu-plugins /文件夹。 如果/ wp-content /文件夹中没有mu-plugins文件夹,则需要创建一个。

After that you need to go to /wp-content/plugins/plugin-organizer/lib/ folder and download the file called ‘PluginOrganizerMU.class.php’ to your computer.

之后,您需要转到/ wp-content / plugins / plugin-organizer / lib /文件夹并将名为“ PluginOrganizerMU.class.php”的文件下载到您的计算机。

Copy MU Plugin

Next, you need to go to the /wp-content/mu-plugins/ folder and upload the file from your computer.

接下来,您需要转到/ wp-content / mu-plugins /文件夹并从计算机上载文件。

Upload MU plugin

The Plugin Organizer can now use this file to properly manage your plugins on mobile as well as desktop.

插件管理器现在可以使用此文件在移动设备和台式机上正确管理您的插件。

在移动版本中禁用特定的WordPress插件 (Disable Specific WordPress Plugins in Mobile Version)

Plugin Organizer makes it very easy to disable any WordPress plugins on mobile. Simply head over to the Plugin Organizer » Global Plugins page.

借助插件管理器,可以非常轻松地禁用移动设备上的所有WordPress插件。 只需转到“ 插件管理器”»“全局插件”页面。

You will see two columns on the screen. The first column is for ‘Available items’ which contains all your installed WordPress plugins. The second column is for ‘Disabled items’ with disabled standard and disabled mobile boxes.

您将在屏幕上看到两列。 第一列是“可用项”,其中包含所有已安装的WordPress插件。 第二列是针对具有禁用标准框和禁用移动框的“禁用项”。

Global Plugins

First you need to click on the Disabled Mobile box to expand it. After that drag and drop the plugins you want to disable from the available column to the disabled mobile box.

首先,您需要单击“禁用的手机”框将其展开。 之后,将要禁用的插件从可用列拖放到禁用的移动框中。

Disable plugins in mobile version

After adding the plugins don’t forget to click on the ‘Save’ button to store your changes.

添加插件后,不要忘记单击“保存”按钮来存储您的更改。

That’s all. The plugin organizer will now disable these plugins on your mobile site.

就这样。 插件组织者现在将在您的移动网站上禁用这些插件。

Plugin Organizer also makes it easy to disable individual WordPress plugins for specific posts, pages, user role, and other parameters. For more detailed instructions, see our guide on how to use Plugin Organizer to speed up WordPress.

插件管理器还可以轻松地为特定帖子,页面,用户角色和其他参数禁用单个WordPress插件。 有关更多详细说明,请参阅有关如何使用插件管理器来加快WordPress速度的指南。

We hope this guide helped you learn how to easily disable specific WordPress plugins in mobile version. You may also want to see our list of must have WordPress plugins you should install on your website.

我们希望本指南能帮助您学习如何轻松地在移动版本中禁用特定的WordPress插件。 您可能还希望查看我们的列表,该列表必须包含应在网站上安装的WordPress插件

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-disable-specific-wordpress-plugins-for-mobile-users/

移动端禁用用户复制

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值