Sysadmins of the North (Page 60)

Redirect old URL to new URL or send 404 page with PHP

Redirect pages with PHP. If you've moved some old PHP pages, or URLs, to new pages and URLs, you can use the following PHP code snippet to easily redirect all visitors and incoming requests to the new location. This PHP code snippet uses a 301 Moved Permanently redirect, perfect for SEO and returns a 404 Not Found if a new location hasn't been set up yet.

Read more...

Display commas in WordPress tags

How to use a tag with a comma in it in WordPress? Normally, in WordPress all tags are comma seperated: php, wordpress, website, functions.php. But what if you need to use a tag with commas in it? For instance "cafe, bar, restaurants". Easy, create a filter in your WordPress functions.php, and here is how...

Read more...

How to string replace on all WordPress posts in MySQL

Learn how to replace content in your MySQL database in bulk with MySQL REPLACE. Sometimes it's useful to know how to bulk edit content in your WordPress MySQL database, using MySQL's REPLACE() function. Here is how to string replace content in WordPress wp_posts table to bulk edit WordPress posts through MySQL.

Read more...