woozyg
Forum Replies Created
-
I added this at the top of the
redirect()
function, and it works great, but allowing for UI entry of the strings would be nice:function redirect() { /* ignore bot user-agent values */ if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/(googlebot|facebookexternalhit|Twitterbot|twitterbot)/", $_SERVER['HTTP_USER_AGENT'])){ return; } ...
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainIn fact, she just thanked you by purchasing the pro version, even though we don’t currently need the pro features. And you will get a geek shout-out in her next post about the site changes.
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainAdding that filter fixed the like count, so I must be using your button now ??
Thank you for your help! I’m a hero to my wife thanks to you.
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainHmm. Thanks for the clarification. I think the issue is indeed two plugins doing FB stuff. I’ll track down which one is providing the Like button and figure out how to use yours instead.
Thank you for all your help on this, you’ve saved me a ton of time speeding up my learning curve.
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainHere is a good page to check:
https://bethwoolsey.com/2013/05/20-things-every-parent-should-hear/
old page:
https://putdowntheurinalcake.com/2013/05/20-things-every-parent-should-hear/
the new one properly has pudowntheurinalcake.com as the og:url domain, but the Like button is using the above domain. The old domain page has 17,000 likes.
[Moderator Note: Please ensure that you are embedding links correctly in your posts.]
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainThanks! That function worked like a charm, FB sees the proper old URL as the canonical graph URL for old posts.
However, the “Like” button added by the plugin to posts does not use the calculated graph URL, instead it still uses the current page URL, which as the new domain.
Is there a way I can use the filter to also filter the URL passed to the “Like” button?
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainThat looks promising. Where would I put the filter and function? I can handle testing and debugging any issues with the regex, if I just knew where to add this awesome bit of code ?? As the old joke goes, it’s all about knowing where to put the X. I’m an old Java web guy, new to PHP and the WordPress platform and APIs. Still figuring out what I can touch where without breaking updatability or causing terminal performance issues.
Thanks for the help, my wife is very relieved to have a possible solution for keeping the social credibility and history for content she’s worked hard to develop.
Forum: Plugins
In reply to: [NextGEN Facebook] Keeping OG URLs when changing site domainYes, I agree, the solution seems quite reasonable, the where and how of it is the question.
To answer your questions, yes, it around 250 old posts in question, only the domain needs to change, and the cut-off can be by post ID – less than or equal to post ### (or strictly less than ###+1) gets the old domain, everything greater uses the current domain. The post that identifies the divide can be termed the “last to use the old domain” or “first to use the new domain” and the logic flow from that distinction.
I got the idea from this stackoverflow question.
In our case, I can figure out how to handle the 301 redirect for links coming in to the old domain, but making the og:url value for the page rendered under the new domain reference the old domain is where I need help.
Thank you!