Meta Box Lite
Meta Box

Custom Fields Fundamentals

Basics about custom fields: what they are, how they work, what are applications, etc. to help you use custom fields in WordPress skillfully and effectively!

Optimizing Database for Custom Fields in WordPress

Optimizing Database for Custom Fields in WordPress

Custom fields is a way for WordPress to store arbitrary extra data for content (posts and custom post types), such as author name, published date for a book. To make custom fields flexible and compatible with different kinds of data, WordPress designs the meta tables (post meta, term meta, user meta, and comment meta) in the form of key-value. According to that, each custom field is stored as one row in the database. This approach allows developers to store unlimited data regardless of its structure. But, the downside is the rapid bloat of the database. Because the number of custom fields is usually very large. This article will present solutions to optimize the storage of custom fields in the database to help boost your website performance.

Continue reading "Optimizing Database for Custom Fields in WordPress"

What is custom fields in WordPress

What is Custom Fields in WordPress?

Custom Fields is an important and useful feature in WordPress and bring us a very high customization ability. So, let's find out the basics, relevant techniques, and excellent applications of Custom Fields in this series.

If you've already reached WordPress, you also heard that it is a top platform for quickly building blogs. Furthermore, its partial actual power is Custom Fields, which took part in the WordPress' strong development and taking up leading position in CMS over previous 15 years.

Continue reading "What is Custom Fields in WordPress?"

Easy way to add custom fields in WordPress without plugins

Easy Way to Add Custom Fields in WordPress Without Plugins

In the previous post, we have learned the basic concepts of custom fields and their applications. In this post, we will learn how to add custom fields to a WordPress site without coding or using a third-party plugin.

We have said in the latest post that WordPress has a default function that helps end-users manage custom fields in a simple way. You may add as many fields as you want with any names you like.

Let's get started to find them out!

Continue reading "Easy Way to Add Custom Fields in WordPress Without Plugins"

How to Create Custom Meta Boxes and Custom Fields in WordPress

How to Create Custom Meta Boxes & Custom Fields in WordPress?

The default custom fields functionality in WordPress is to help end-users add content and customize their websites fast and easily. However, it is limited to only text fields and thus, is not enough in most cases. Then you may want to look for a plugin that can help you create fields in any type to save any kind of data as Meta Box plugin, it’s so easy. But you know what, even when you don’t want to use any plugin from others, you can create one by yourselves to create new custom fields in your totally new types.

Continue reading "How to Create Custom Meta Boxes & Custom Fields in WordPress?"

Get Posts by Custom Fields in WordPress

Get Posts by Custom Fields in WordPress - Part 1

In the previous articles, we've known about what Custom Fields is and the application of custom fields which allows users to add arbitrary information into posts. But what do you do after that? In the recent post, you also learned how to add custom fields programmatically and display them in your theme. But you’ll see a shortcoming if there is no classification and searching. This post will guide you on how to get posts by custom fields in WordPress and we'll create an interesting application: advanced search.

Continue reading "Get Posts by Custom Fields in WordPress - Part 1"

How does WordPress Store Custom Fields

How does WordPress Store Custom Fields? #1: Data flow

Until now, we’ve known what custom fields is and how to use the functions provided by WordPress to work with custom fields. You’ve prepared everything needed to develop practical applications. But wait, before embarking on doing something new, you had better dig a bit deeper to have thorough understand custom fields' nature. It’s time to find out an answer to the question: “What really happens with custom fields when I click Save post?”. The two coming posts will give you the answers.

Continue reading "How does WordPress Store Custom Fields? #1: Data flow"

Get Posts by Custom Fields in WordPress - Part 2

Get Posts by Custom Fields in WordPress - Part 2

In part 1 of this series, we learned about how to get posts by custom fields in WordPress with the WP_Query function. However, if we need to deal with databases, it’s better to find another faster, easier, and more convenient way. That method is joining wp_posts and wp_postmeta tables together, and then querying by SQL. In part 2 of the series “How to get posts by custom fields in WordPress”, we’ll use this way to add the advanced searching feature that allows users to search by keywords in posts / pages titles and custom fields content.

Continue reading "Get Posts by Custom Fields in WordPress - Part 2"