Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
Like Tree10Likes

Thread: Tip for adding schema to a wordpress site with Yoast

  1. #11
    heckler is offline Member
    Member Since
    Oct 2014
    Location
    Austin, TX
    Posts
    283
    Thanks
    48
    Thanked 82 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    Great tip James.
    James Watt likes this.

  2. #12
    Tim Sweeney's Avatar
    Tim Sweeney is offline Member
    Member Since
    May 2015
    Location
    Binghamton, NY
    Posts
    37
    Thanks
    211
    Thanked 13 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    James - Thanks! Since I'm more of a marketer than designer/programmer I try to tread lightly when it comes to modifying something such as the functions file. Making backups, trying it on a staging site has so far saved me from a major issues. Thanks again.
    James Watt likes this.

  3. #13
    djbaxter's Avatar
    djbaxter is offline Administrator
    Member Since
    Jun 2012
    Location
    Ottawa, Canada
    Posts
    2,865
    Thanks
    1,279
    Thanked 573 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    To answer your other question, Tim, any edits to core Wordpress files will indeed be overwritten the next time Wordpress updates.



  4. Members who thanked djbaxter for this post:

    Tim Sweeney (01-31-2017)

  5. #14
    djbaxter's Avatar
    djbaxter is offline Administrator
    Member Since
    Jun 2012
    Location
    Ottawa, Canada
    Posts
    2,865
    Thanks
    1,279
    Thanked 573 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    Quote Originally Posted by djbaxter View Post
    To answer your other question, Tim, any edits to core Wordpress files will indeed be overwritten the next time Wordpress updates.
    There are, however, some Wordpress plugins that allow you to insert scripts into the < head > section of your Wordpress plugins.

    That way, your additions would not be overwritten when Wordpress updates.

    This may be a way to do this without having to edit core files? (I haven't tried this.)

    See https://wordpress.org/plugins/search...q=head+section

  6. Members who thanked djbaxter for this post:

    Tim Sweeney (01-31-2017)

  7. #15
    James Watt's Avatar
    James Watt is offline Top Contributor
    Member Since
    Oct 2013
    Location
    Portland, OR
    Posts
    625
    Thanks
    121
    Thanked 211 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    @Tim, yeah, I know more than the average bear maybe, but I'm no seasoned developer. Sometimes I know just enough to get myself into trouble... and even the most seasoned developers should all still use staging sites and testing. My background's in videogame programming originally, and I could tell you some stories about just how important testing is in a big team environment. I know a guy back in college working at a game company that had several days where no one could do work, always because someone committed some broken code at 1am the night before and hosed everything. The next day you'd have everyone sitting around, while one guy was furiously trying to fix what he'd accidentally broken. Testing, no matter your skill, is always important, especially on live client sites.

    As far as editing the core wordpress files, and changing the and such... yeah, never edit any wordpress core files. You should never edit any plugin files either, or any theme that you think might be updated someday. Child themes are there in fact so that you can make changes without risking them getting overwritten next time the theme updates. As for adding stuff to the head section, usually I'm working in a custom theme, and you just change things in the header php file, but if you don't have that set up, a plugin might be the way to go.
    Last edited by James Watt; 02-01-2017 at 03:12 PM.

  8. Members who thanked James Watt for this post:

    Tim Sweeney (02-01-2017)

  9. #16
    Eric Rohrback's Avatar
    Eric Rohrback is offline Global Moderator
    Member Since
    Oct 2012
    Location
    Pittsburgh, PA
    Posts
    832
    Thanks
    120
    Thanked 220 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    Quote Originally Posted by seoWest View Post
    Hey James,

    A few days ago when I first added the code, things were working great, however, I just checked-back on the site, and now I am getting the following Warning in the browser:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'remove_json_ld_output' not found or invalid function name in /wp-includes/plugin.php

    Any idea how to resolve this?

    Thanks!

    Dino
    Check for extra spaces or missing brackets/missing elements. Simple errors like that in the php files will crash the site.

    Always use a child theme to make custom changes like this to a site, otherwise everything you do will be overwritten (as others have pointed out).

  10. #17
    James Watt's Avatar
    James Watt is offline Top Contributor
    Member Since
    Oct 2013
    Location
    Portland, OR
    Posts
    625
    Thanks
    121
    Thanked 211 Times

    Re: Tip for adding schema to a wordpress site with Yoast

    Quote Originally Posted by Eric Rohrback View Post
    Check for extra spaces or missing brackets/missing elements. Simple errors like that in the php files will crash the site.

    Always use a child theme to make custom changes like this to a site, otherwise everything you do will be overwritten (as others have pointed out).
    missing semi colons and such can definitely cause problems. In this case though, it's just because the remove_json_ld_output function wasn't defined. I updated my code snippet, it should work fine now.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. WordPress Schema.org plugins: Thoughts and recommendations?
    By djbaxter in forum Local SEO Tools & Software
    Replies: 1
    Last Post: 05-10-2014, 10:45 AM
  2. WordPress: Major update to Yoast's Local SEO plugin
    By djbaxter in forum Local SEO Tools & Software
    Replies: 0
    Last Post: 12-04-2013, 07:06 PM
  3. New Schema Creator WordPress Plugin
    By Linda Buquet in forum Local SEO Tools & Software
    Replies: 13
    Last Post: 08-02-2013, 12:04 PM
  4. New Local SEO Wordpress plugin from Yoast
    By Nick Rink in forum Local SEO Tools & Software
    Replies: 10
    Last Post: 05-30-2013, 05:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •