Linux 软件免费装
Banner图

REST API - Head Tags

开发者 poliuk
luisherranz
rmartinezduque
orballo
davidarenas
santosguillamot
frontity
更新时间 2021年3月27日 01:08
PHP版本: 5.6 及以上
WordPress版本: 5.7
版权: GPLv3
版权网址: 版权信息

标签

tags meta seo api rest head yoast frontity

下载

1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.0.0 1.2.1

详情介绍:

This plugin adds all the tags in the head section of a website to WordPress REST API responses. It is perfect if you are using WordPress for a headless set-up and would like to add the meta tags generated by your WordPress SEO plugin (like Yoast SEO or All-in-One SEO Pack) to the WordPress REST API output. Requirements This package depends on the PHP DOM library. Most PHP environments have it by default so you don't have to worry about that.
In case you get some errors regarding this dependency make sure you have this library installed (you can take a look at this thread in the code repository).
Compatibility This plugin is compatible and works out of the box with some of the most popular WordPress SEO plugins. These are the ones that we tested: Are you using a different SEO plugin and want to know if it's compatible? Feel free to ask in our community forum. If you tested any other plugin, please let us know as well so we can update the list.

安装:

  1. First of all you have to install the plugin. You can do it:
  2. Automatic: from within WordPress dashboard go to Plugins, click Add New button, search for REST API - Head Tags by Frontity and click Install Now.
  3. Manual: this method requires to download the plugin and upload it to your web server via FTP. For a more detailed explanation, WordPress explains how to do this on this guide.
  4. Once installed, you have to activate it and it will be running! The head_tags field is cached and enabled by default, but you can purge the cache or disable the output as explained on the Settings section.

屏幕截图:

  • REST API Head Tags Settings
  • WordPress REST API response example

常见问题:

Can I use the plugin only within a Frontity project?

No, you can use it for any headless WordPress project. However, if you use Frontity, you can get all the data automatically with this Frontity package. On the other hand, if you are not using Frontity, you have to add the data manually as explained on the plugin's documentation.

I have installed and activated the plugin, where can I find the tags?

You can find the head tags exposed in the WordPress REST API after making an API request. You can find a new field named head_tags which is an array of all the meta tags, just as they appear in the web page section. You can see more information at the plugin docs.

Where can I find the head tags of the homepage?

If you are not using this Frontity package (which will automatically add the head tags), you should fetch this data at /wp-json/wp/v2/types/post endpoint.

Will the plugin add the meta tags to my custom post types and custom taxonomies?

Yes, the plugin will automatically add the meta tags to the custom post types and custom taxonomies. You can check which entities show the new field on its docs.

Is this plugin compatible with Yoast SEO plugin? And with All in One SEO Pack?

Yes, it works with both Yoast SEO and All in One SEO plugins. We actually plan to make it compatible with most of the WordPress SEO plugins. If you test it with any other plugin, kindly let us know whether it works or not so we can update the list.

更新日志:

1.2.1 Patch Changes: 1.2.0 Minor Changes: 1.1.4 Patch Changes: 1.1.3 Patch Changes: 1.1.2 Patch Changes: 1.1.1 Patch Changes: Fix redirects when making calls to the REST API. 1.1.0 Minor Changes: Added integration with All In One SEO Pack plugin. 1.0.1 Patch Changes: Fix the registering of activation / deactivation hooks. 1.0.0 Major Changes: Release the first version of REST API - Head Tags plugin.