WordPress rename/change Post name to a different post type

There are times when you wold like to rename the default posts to something else. For example, I used a WordPress installation to created a real estate related website from a standard WordPress install.

I needed to add a custom post houses so that the client would be able to add the content to the website, but on the other hand I did not need to use the standard post type since I did not need the blog or news section. So why not convert it to something else. Continue reading “WordPress rename/change Post name to a different post type”

The easy way to migrate WordPress using search and replace database

So you want to migrate a WordPress database and you came into the problem that when you load the new installation directory you are being redirected to the old domain. You probably tried to manually replace in your PhpMyAdmin in the wp_options  table the two entries that normally exist, but still no success. Maybe your website is loading but there are lots of errors in there.

This is because WordPress and lots of plugins store data and full URI in the database using wp_serialize function. Here is a little example about what I am talking about:

If you just do a search and replace you will break all this fields and data can not be recovered.

Continue reading “The easy way to migrate WordPress using search and replace database”

PHP check if mail() function is enabled on your server

To check if mail function is enabled on your apache server you can try one of the following:

Check your php.ini like this:

You should search for this in the list sendmail_path that has the default  value /usr/sbin/sendmail -t -i

You can also try to manual set it to this value by changing the php.ini file. To do this go to  /etc/php5/apache2/php.ini and uncomment the sendmail_path line like this

Continue reading “PHP check if mail() function is enabled on your server”

Complete case study: watermark detection, remove and place a new watermark- Part II

Like I said in the previous article “Complete case study: watermark replacement – part I” about replacing an old or outdated  watermark, this task is not quite trivial but more likely boring and very time-consuming.

Anyway…let’s continue. I have now separated all images by:

  • logo in the center
  • multiple logos all over.

I will try to process the images that have the logo in the center. In this group I have little bit over 40.000 images. Continue reading “Complete case study: watermark detection, remove and place a new watermark- Part II”

WordPress automatic database optimization and repair

Did you know that WordPress websites accumulate overhead due to SQL queries that are being processed.  Overhead when referring to databases, is the temporary disk space that it is used to run some of the queries. This overhead is bad for table scan, i. e. when your query needs to run over all table values, it will need to look at more empty space.

Every database will, over time, require some form of maintenance to keep it at an optimal performance level. Purging deleted rows, resequencing, compressing, managing index paths, defragmenting, etc. is what is known as optimization in mysql and other terms in other databases. Continue reading “WordPress automatic database optimization and repair”

POP vs IMAP vs SMTP vs Forwarding emails

POP vs IMAP, the eternal fight. What is POP and what is IMAP, and what in the hell is SMTP, this one is new, not to mention email forwarding. Here is the answer to all that:

What is POP Protocol

Post office protocol (also called POP) downloads email directly to your computer. When this happens, the mail is deleted from the ISP server. This process occurs to prevent you from reading the same email messages again when you access the ISP server from another computer. The benefit of POP mail is since messages are downloaded directly to your computer, you can read them even if you aren’t connected to the Internet. Continue reading “POP vs IMAP vs SMTP vs Forwarding emails”

Complete case study: watermark detection, remove and place a new watermark – Part I

Replacing a watermark over one image can be an easy task. Replacing it on a 50.000 set of images, can be a tricky job to do.

This case is really simple. The company change their logo. They have all the images on their website watermarked with their old logo and they wanted to re-watermark all the images. They did not stored the original photos on upload but stored just the new watermarked ones.

So here is where I came in and try to sort things out. Continue reading “Complete case study: watermark detection, remove and place a new watermark – Part I”

Remove the URL field from the WordPress comment form

Here is a simple code snippet to remove the URL field from WordPress comment form.

Marking as spam all the comments that have very long URLs in the website field will help you tackle spammers. However, if you find that spam is getting out of control, you may want to consider removing the website URL field altogether.

If you implement the snippet below and configure your WordPress discussion settings so that any comment with a link is held for moderation; you can effectively stop all spam entirely. Continue reading “Remove the URL field from the WordPress comment form”

How to change spell check language by right-clicking on a text in Chrome

Bad news for you, this option have been removed in chrome. Since the update of December 2015 the spell check option from the right-click menu disappeared and so you can not change the language for the spell checker as you normally would.

The good news is that in Chrome 47 was implemented the automatic spell checker in multiple languages!  So you can continue to type in different languages, and Chrome will automatically spell check all of your input text without you needing to manually change languages.

Continue reading “How to change spell check language by right-clicking on a text in Chrome”

Mark comments with very long URLs as SPAM in WordPress

To mark comments with very long URLs as SPAM in WordPress you must have access to the theme  functions.php  file and permission to edit it.

Spammers frequently use links to web pages that have very long URLs. Therefore, if someone publishes a comment on your WordPress site and enters a very long URL in the comment field, there is a high possibility that the comment was published by a spammer. Continue reading “Mark comments with very long URLs as SPAM in WordPress”