Workshop » Reference Section » Grimoires » IT » Platforms » Web » WordPress » Yoast

CURL and Browser get different page versions (301 redirects, content changed, etc. — due to Yoast url parameter stripping only for non-logged-in users)

I had a truly maddening problem where my /embed/ functionality was sometimes returning full pages to CURL commands and online services like redirect-checker.org, etc.

It turned out, it was Yoast's URL parameter stripping. I had failed to update Yoast's settings with some new parameters I was using, and what Yyoast never tells you is that when you're logged in, it lets everything work fine, and only strips parameters for non-logged in users. It just lets you proceed on your way thinking everything is working fine until you can't figure out why curl -I https://mysite.com/blah?param1¶m2 is getting a 301 redirect while https://mysite.com/blah?param1¶m2 is loading fine in your browser. This is especially fun on sites like mine where things like /embed/ and ?embed get written back and forth to each other internally.

I lost several hours to this.

Yoast's docs say there's a way of registering parameters but,…

private » Programming Hacks Used In This Site
Adding A Default Featured Image Or Thumbnail In WordPress

All Thumbs: Adding A Default Featured Image Or Thumbnail In WordPress

What's a featured image in WordPress?

WordPress, the software this site runs on, works by allowing authors to enter web page content (sometimes officially called 'posts', as in a blog post, and which I often colloquially on this site refer to as an 'article') which it then formats nicely to display in web viewers. When you enter a post, it lets you specify a bunch of other information pertaining to it: category, some additional tags, a custom summary to show search engines, etc. Among the things it allows you to specify is a 'featured image', or 'thumbnail', an image representing that post.

You see featured images all over the site: in the backgrounds of individual pages, as tiny squares next to the menu entry for a page in the menus up top, on the "Related Posts" entries at the bottom of a lot of pages, or in…