WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
[resolved] All in One SEO Pack Conflicts with Twenty Twelve (21 posts)

  1. aisajib
    Member
    Posted 1 year ago #

    I recently discovered a post and page title conflict with Twenty Twelve theme. My blog's title "Around Android" was being displayed like this:

    A PostAround Android | Around Android

    While it was supposed to be like this:

    A Post | Around Android

    I've spent hours looking for the issue. And then suddenly I discovered the issue is happening to Twenty Twelve theme only. I rolled back to Twenty Ten or Twenty Eleven and the problem disappeared. Then I reactivated Twenty Twelve and deactivated All in one SEO pack plugin only to see that the problem was gone!

    That made me believe the plugin has some sort of conflict with Twenty Twelve theme. I've tried everything possible and the result was always same.

    Twenty Twelve + All in one SEO Pack = Duplicate Title
    Any other theme + All in one SEO Pack = OK
    Twenty Twelve + Deactivated All in one SEO Pack = OK

    Requesting plugin author's attention.

    Example page: http://www.aroundandroid.com/2012/09/24/how-to-share-android-phones-internet-with-computer-via-usb-data-cable/

    http://wordpress.org/extend/plugins/all-in-one-seo-pack/

  2. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    aisajib,

    This is because Twenty Twelve is already adding the blog title into the page title in wp_title() on its own; you can correct this like so by running this code between when the wp_enqueue_scripts hook runs and when the wp_title hook runs:

    remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    This is because Twenty Twelve is already adding the blog title into the page title in wp_title() on its own;

    Which is the current recommended best practice. See this Codex page.

  4. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    esmi,

    Using wp_title() is the current recommended best practice, yes; but having the theme append the blog title to the page title isn't covered by that policy, which is the issue at hand presently.

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    The wp_title() function should not be used by a theme in conjunction with other strings or functions (like concocting with bloginfo('name') ) to set the title because it will render plugins unable to rewrite page titles correctly. The best practice is to use the wp_title filter with a callback function. This method is now a requirement for themes.

    http://codex.wordpress.org/Function_Reference/wp_title

    And there's even an example in http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title with uses get_bloginfo( 'name' ).

  6. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    esmi,

    Yes, we're in agreement here, thanks.

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    I don't see how we can be. You seem to be implying that Twenty Twelve (the next WP default theme) is doing something wrong when, in fact, it is following all of the best practice recommendations.

  8. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    esmi,

    My issue is not that it can rewrite wp_title(), I agree that it can; however, it does rewrite wp_title(), in a way that the previous default themes did not. That's not necessarily wrong, but it is a change in behavior, and therefore may be unexpected; what I provided was a way to make it function like the old behavior. The point to talk about would be, should a theme be doing this in the first place, or should it be left up to a plugin. So it's not a question about theme guidelines; as far as I know, WPTRT doesn't have guidelines relating to having SEO in themes.

  9. esmi
    Forum Moderator
    Posted 1 year ago #

    it does rewrite wp_title(), in a way that the previous default themes did not.

    The revisions have been made specifically so that plugins can hook into wp_title() far more easily as this was causing issues for other plugins - including, I think, SEO plugins.

    should a theme be doing this in the first place, or should it be left up to a plugin

    It's gone well beyond that now. This IS the best practice recommendation for all WP themes and is mandated for all themes being submitted to the WPORG Repository.

  10. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    esmi,

    What is the best practice recommendation for having SEO embedded in a theme, then, or is there one?

  11. esmi
    Forum Moderator
    Posted 1 year ago #

    Rule of thumb: a theme shouldn't be trying to do the job of a plugin (although, I agree that the line between the two can get a little fuzzy sometimes). Since the meta title tag is part of the HEAD section of any web page (WordPress generated or other), it's seen as clearly part of a theme's remit providing the theme ensures that some control remains in the hands of the site authors (via page titles etc).

    Not sure what the view would be regarding a submitted theme that auto-generated (for example) meta-descriptions. I've done that with custom themes myself - either by using the_excerpt_rss() or, even better, by adding it as a custom meta box to the Post/Pages Edit form. It might be acceptable if the theme also offered the option to turn this off (so as to avoid clashed with SEO plugins) but you'd need to check with the theme review team on that point.

    You also need to bear in mind that many site owners (myself included) don't use SEO plugins at all but build SEO into the content of the site and perhaps use a Google XML sitemap plugin as well. Hand crafted, if you will. The Codex's Search_Engine_Optimization_for_WordPress has the same initial approach & includes a lot of practical advise on the subject.

  12. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the advice and pointers, esmi!

  13. esmi
    Forum Moderator
    Posted 1 year ago #

    No problem. :-)

  14. margje
    Member
    Posted 1 year ago #

    Peter, All,

    Same problem here, but I don't understand the solution.

    running this code between when the wp_enqueue_scripts hook runs and when the wp_title hook runs:

    remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

    Where, exactly do i have to run this code: remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

    I mean, in which file do i have to insert the above line?

  15. margje
    Member
    Posted 1 year ago #

    update, i've added this:

    <?php remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 ); ?>

    to header.php above the title tag. Is that the right way to do it?

  16. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    margje,

    As long as it's before when the title is getting output by wp_title(), then it should work. There will be a more comprehensive fix for this in the future, in the next major release, to allow better management of titles and title rewrites.

  17. kusaziva
    Member
    Posted 1 year ago #

    Peter

    I added the

    remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

    just before the title tag, like so:

    <?php remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 ); ?>
    <title><?php wp_title( '|', true, 'right' ); ?></title>

    but it hasn't worked. Strangely only the single post page and the is_tag() pages are affected. category pages are showing up just fine. Please help.

  18. lucacicca
    Member
    Posted 1 year ago #

    I solved this problem, excluding the option "Rewrite Titles" in All in One SEO Plugin Options. Now the title of pages and posts is "postname | blogname"

  19. kusaziva
    Member
    Posted 1 year ago #

    thanks lucacicca. fixed.

  20. adamlogix
    Member
    Posted 1 year ago #

    I am having a problem that I'm unsure is related. No matter where I change the title of a blog post I get the following message under the Meta Tags Optimization section of the post edit page. "The title is <64 characters and the keyword is NOT located at all"

    If I delete the Title from both the post and the All in one SEO pack section I get a message saying there is not title.

    The problem is that the title is the keyword, word for word...

    I have found no option that I check or uncheck to solve the issue...

  21. Michael Torbert
    WordPress Virtuoso
    Plugin Author

    Posted 1 year ago #

    Hi Adamlogix,

    This is an issue with the Meta Tags Optimization plugin, not All in One SEO Pack.

    Also, you should start a new thread instead of hijacking an unrelated one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic