Accelerated-mobile-pages: Test titles with The SEO Framework Plugin

Created on 6 Apr 2017  路  2Comments  路  Source: ahmedkaludi/accelerated-mobile-pages

Test titles with The SEO Framework Plugin

Ref: https://wordpress.org/support/topic/strange-seo-yoast-or-die/

Most helpful comment

The issue is that it actually removes WordPress legacy code within function ampforwp_remove_title_tags().

Instead, you should filter wp_get_document_title():
https://github.com/Automattic/amp-wp/blob/22b8287c8a84f774f73942c3c08027ddad3f1e0d/includes/class-amp-post-template.php#L52

Stack:

  1. https://developer.wordpress.org/reference/functions/wp_get_document_title/
  2. Filter pre_get_document_title at priority 10.
  3. Run ampforwp_add_custom_title_tag() in the title.

SEO plugins usually remove all other filters, so the compatibility will be set automatically.

I'll send a PR. Be sure to test it out before including it, both with legacy settings and in combination with SEO plugins (Yoast/AIO/TSF/etc.).

All 2 comments

The issue is that it actually removes WordPress legacy code within function ampforwp_remove_title_tags().

Instead, you should filter wp_get_document_title():
https://github.com/Automattic/amp-wp/blob/22b8287c8a84f774f73942c3c08027ddad3f1e0d/includes/class-amp-post-template.php#L52

Stack:

  1. https://developer.wordpress.org/reference/functions/wp_get_document_title/
  2. Filter pre_get_document_title at priority 10.
  3. Run ampforwp_add_custom_title_tag() in the title.

SEO plugins usually remove all other filters, so the compatibility will be set automatically.

I'll send a PR. Be sure to test it out before including it, both with legacy settings and in combination with SEO plugins (Yoast/AIO/TSF/etc.).

Hey @sybrew thanx for the info and also for the commit, will check the PR thoroughly 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prayagverma picture prayagverma  路  3Comments

pegazee picture pegazee  路  7Comments

MohammedKaludi picture MohammedKaludi  路  8Comments

saranshkataria picture saranshkataria  路  5Comments

beingsmart3 picture beingsmart3  路  7Comments