Hack: Create a Simple 404 Log

When someone links to your site with the wrong URL, or, worse, you link to your own site with the wrong URL, it would be nice to know. You could check your server’s logs for 404 errors to see what bad URLs people are using. But I find it easier to create a simple 404 log file that I can access without much hassle. Then I check it every once in a while to see if I need to add a redirect to the correct page so I don’t miss some traffic.

Continue reading “Hack: Create a Simple 404 Log”

Hack: Create a Simple Non-WordPress Page

I came across this issue while trying to build a sitemap script inside of a WordPress plugin. In the past, I’ve just created a stand-alone PHP page that accesses WordPress and displays the sitemap. But I wanted to keep this code inside the plugin code. The problem is, you typically use plugin code to create contain insider a WordPress frame. But I just wanted plain text here, not the header and footer and all of that.

Continue reading “Hack: Create a Simple Non-WordPress Page”

Hack: Alter Post Title Tag Depending On the Category

So yesterday I showed you how to change the post title, as in the H1 tag of the post page, based on the category of the post. That doesn’t change the title tag, however. Users don’t see or pay attention to the title tag as much, especially with browser tabs only offering limited space for them. But search engines see these and use them in search results.

Continue reading “Hack: Alter Post Title Tag Depending On the Category”