Support » Plugin: All in One SEO - Best WordPress SEO Plugin - Easily Improve Your SEO Rankings » How to remove AIOSEO title only in posts

  • Resolved olimate

    (@olimate)


    After the update to 4 version my site doesn’t works anymore. I used a custom title only for posts, and before the update worked fine. So, how can I remove AIOSEO titles for all posts (single.php) in the new version 4 to use my custom title defined only for posts?

    Thanks in advance!

    • This topic was modified 5 months, 4 weeks ago by olimate.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author benjaminprojas

    (@benjaminprojas)

    @olimate,

    Thanks for reaching out!

    You can set a global title for all your posts here under the Search Appearance > Custom Post Types tab.

    More information about that can be found here: https://aioseo.com/docs/setting-the-seo-title-and-description-format-for-custom-post-types/

    You mentioned that the titles changed after the update to version 4. What exactly are you seeing in the area above as well as in your posts themselves?

    We have had a few reports of some themes that are not fully working with AIOSEO so I’m curious if this might be a theme conflict.

    What theme are you currently using?

    Thread Starter olimate

    (@olimate)

    Hi, thanks for your reply.

    I’m using a custom template where the single posts display as a title, the post title + the custom post title (a relationship ACF Advanced Custom Field).

    So, in the AIOSEO setup, the field for title posts was blank because I used in my header.php this:

    <?php if (is_single() ) : ?><title><?php the_title(); ?> • <?php $post_object = get_field('author'); if( $post_object ): $post = $post_object; setup_postdata( $post ); ?><?php the_title(); ?><?php wp_reset_postdata(); ?><?php endif; ?></title><?php else : ?><title><?php wp_title(''); ?></title><?php endif; ?>

    And it was worked fine, since the last update to version 4 (so I downgrade to 3 again).

    Any idea how to solve it?

    Plugin Author benjaminprojas

    (@benjaminprojas)

    @olimate,

    Thanks for letting us know about how you are using titles. That is really helpful.

    In our next release, we will have a filter where you can disable the title rewriting that we are doing and it should address this issue. The filter will be:

    aioseo_disable_title_rewrites

    Just make sure that returns true and our code will no longer run to rewrite the title.

    I’ll let you know when the release has gone out with this filter.

    Plugin Author benjaminprojas

    (@benjaminprojas)

    We’ve just pushed out an update that should fix this issue. Can you update to 4.0.9 and see if that resolves it? You’ll need to use the filter mentioned above and it should return true to disable our rewrites.

    Thread Starter olimate

    (@olimate)

    Thanks for your support Benjamin!

    I think it works now. I just updated the plugin and add this function to my functions.php file:

    add_filter( 'aioseo_disable_title_rewrites', 'change_wordpress_seo_title' );
    function change_wordpress_seo_title(){
        return true;
    }

    So now, all the AIOSEO titles defined in the plugin are not displayed. But, do you know how can apply it only in single.php posts?

    Thanks in advance!

    • This reply was modified 5 months, 4 weeks ago by olimate.
    Plugin Support arnaudbroes

    (@arnaudbroes)

    Hey @olimate,

    Try this –

    add_filter( 'aioseo_disable_title_rewrites', 'change_wordpress_seo_title' );
    function change_wordpress_seo_title(){
        if ( is_singular() ) {
            return true;
        }
        return false;
    }

    – Arnaud

    Thread Starter olimate

    (@olimate)

    Hi Arnaud,

    Thanks for your reply but still doesn’t works. My single.php still adding the AIOSEO title:

    <!-- All in One SEO 4.0.9 -->
    <title>TEST</title>

    Rather than the one is defined in my header.php

    <?php if (is_single() ) : ?><title><?php the_title(); ?> • <?php $post_object = get_field('author'); if( $post_object ): $post = $post_object; setup_postdata( $post ); ?><?php the_title(); ?><?php wp_reset_postdata(); ?><?php endif; ?></title><?php else : ?><title><?php wp_title(''); ?></title><?php endif; ?>

    Anyway, Merry Xmas!

    Plugin Support arnaudbroes

    (@arnaudbroes)

    Oh sorry, I forgot that we have an issue open to move the hook elsewhere because it currently runs somewhere where the query/context info isn’t available yet. That’s why that code snippet is failing. We should fix this soon in one of the next updates.

    Merry Christmas to you too!

    Thread Starter olimate

    (@olimate)

    I can confirm that now it works without the need to add extra code in functions.php. I really appreciate this, thanks!

    Plugin Support arnaudbroes

    (@arnaudbroes)

    Awesome, glad to hear it. Thank you for following up on that and providing us with some feedback!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.