Support » Everything else WordPress » Pingback contains javascript code instead of post content

  • I’m working with a client which has two WordPress blogs dealing with similar topics. Occasionally, they link to one another, so pingbacks are sent between the two blogs.

    However, the content of the pingbacks contain random parts of the linked posts and not the content of the posts. The included content may be navigation menus, bread crumbs, or even javascript code that is part of the theme file generating the link.

    I know that I can edit the pingback comment manually, but the client would like this done automatically. Is there any way I can control what content gets included in the pingback comment?

    I wrote both of the themes from scratch, so if there is a way I could tell WordPress to use the content that is part of a certain div or paragraph tag, then that would be great.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    even javascript code that is part of the theme file generating the link

    Well. That would be why. Pingbacks look for the part of the content that has the link.

    Thread Starter RockoRobotics

    (@rockorobotics)

    Sorry, I wasn’t to clear with this line:

    even javascript code that is part of the theme file generating the link

    What I meant was that in the theme file for that post, there is Javascript. The Javascript has nothing to do with the generating the link. It is used to pull posts from the client’s twitter feed.

    Based on your suggestion, I’ll see if I can figure why the PingBack is targeting the areas that it is.

    The PingBack contains navigation from the top of the page as well as the bottom of the page, but all the content in between is missing.

    Thread Starter RockoRobotics

    (@rockorobotics)

    I have figured where the content is coming from. The page displaying the post has two columns: Left and Right.

    The Left column has the actual blog post content.

    The Right Column has the most recent posts with a one sentence about the post. Below these summaries, there is a section which pulls in the most recent twitter post. The javascript I mentioned earlier is also contained in this right column.

    The PingBack is pulling this right column because in the generated HTML, the right column comes before the left column.

    This brings me back to my original question. Is there anyway I can control what section of the page the PingBack pulls it content from?

    If there is a hook or filter I could use to manually extract the left column when the request to get the PingBack content is made, I could solve this issue.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I believe it grabs whatever’s ‘first’ on the page, so view source and see. You may be able to adjust your divs.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pingback contains javascript code instead of post content’ is closed to new replies.