Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save djvdorp/01df2442cd72152ccc8b05e66ffd0e85 to your computer and use it in GitHub Desktop.
Save djvdorp/01df2442cd72152ccc8b05e66ffd0e85 to your computer and use it in GitHub Desktop.

Revisions

  1. @amboutwe amboutwe revised this gist Nov 20, 2017. No changes.
  2. @amboutwe amboutwe revised this gist Aug 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion yoast_seo_title_remove_post.php
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    *********
    * MULTIPLE ITEMS
    * Multiple of the same type can use an array.
    Example: is_single( array( 123456, 1234567, 12345678 ) );
    Example: is_single( array( 123456, 1234567, 12345678 ) )
    * Multiple of different types can repeat the if statement
    */

  3. @amboutwe amboutwe revised this gist Aug 25, 2017. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions yoast_seo_title_remove_post.php
    Original file line number Diff line number Diff line change
    @@ -3,10 +3,17 @@
    /* Remove Yoast SEO Title From An Individual Post/Page/CPT
    * Credit: Yoast Team
    * Last Tested: Aug 11 2017 using Yoast SEO 5.2 on WordPress 4.8.1
    *********
    * DIFFERENT POST TYPES
    * Post: Change 123456 to the post ID
    * Page: Change is_single to is_page and 123456 to the page ID
    * Custom Post Type: Change is_single to is_singular and 123456 to the 'post_type_slug'
    Example: is_singular( 'cpt_slug' )
    *********
    * MULTIPLE ITEMS
    * Multiple of the same type can use an array.
    Example: is_single( array( 123456, 1234567, 12345678 ) );
    * Multiple of different types can repeat the if statement
    */

    add_filter( 'wpseo_title', 'remove_one_wpseo_title' );
    @@ -15,4 +22,5 @@ function remove_one_wpseo_title() {
    if ( is_single ( 123456 ) ) {
    return false;
    }
    /* Use a second if statement here when needed */
    }
  4. @amboutwe amboutwe created this gist Aug 12, 2017.
    8 changes: 8 additions & 0 deletions yoast_seo_title_remove.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <?php
    /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
    /* Remove Yoast SEO Title From All Pages
    * Credit: Yoast Team
    * Last Tested: Aug 11 2017 using Yoast SEO 5.2 on WordPress 4.8.1
    */

    add_filter( 'wpseo_title', '__return_false' );
    18 changes: 18 additions & 0 deletions yoast_seo_title_remove_post.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <?php
    /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
    /* Remove Yoast SEO Title From An Individual Post/Page/CPT
    * Credit: Yoast Team
    * Last Tested: Aug 11 2017 using Yoast SEO 5.2 on WordPress 4.8.1
    * Post: Change 123456 to the post ID
    * Page: Change is_single to is_page and 123456 to the page ID
    * Custom Post Type: Change is_single to is_singular and 123456 to the 'post_type_slug'
    Example: is_singular( 'cpt_slug' )
    */

    add_filter( 'wpseo_title', 'remove_one_wpseo_title' );

    function remove_one_wpseo_title() {
    if ( is_single ( 123456 ) ) {
    return false;
    }
    }