Adding Meta Boxes to WordPress Websites

From the beginning of WordPress, custom fields have been used in different versions of WP, but then they added metabox support in version 2.5, where users can add extra data to any post or page.  Because you (as a developer or advanced user) can add unlimited number of data fields, it’s a very handy feature.  Imagine having a real estate listing as a post in WP.  There is a requirement to add all the info about a property – adding metaboxes for property size, year, image, and location is the ideal solution!  You don’t have to fiddle in adding these time-consuming details in as part of post body and then styling them with CSS.

 

Adding Your Own Custom Fields

It’s possible to develop and add your own custom fields, the documentation is available on the official WordPress documentation website.  Here you will also find a number of other tutorials.

 

Using Plugins

But using a plugin is way easier and faster. Some plugins give you a possibility to add custom meta boxes via admin UI.

  • If you are a developer and don’t want to have extra widgets or settings floating around in the dashboard then I recommend using CMB2 plugin. I’ve used this framework for 2-3 years and it’s been very reliable, very well documented and easy to use.

CMB2 plugin adds metabox framework, which you can extend in your own plugin or theme. I recommend creating your own plugin, require CMB2 plugin as a dependency and just add all necessary metaboxes. Below you will find step-by-step directions.

 

Directions

Step 1. Install CMB2 plugin and activate it.

 

Step 2. Create new folder inside wp-content/plugins. For example ndm-plugin and then create index.php inside this folder.

Insert this code (change meta info to your name), this initiates new plugin and requires CMB2 to be installed and active.

 

Step 3. Create post-metabox.php file inside your new plugin folder and add all your metaboxes there. (sample code which you can copy and change is inside wp-content/cmb2/example-metaboxes.php).

 

Step 4. Create as many files inside your plugin folder as you want, for example you can add metaboxes for pages (or specific page), so your file name would be home-metaboxes.php pages-metaboxes.php and then require this file(s) in your index.php.

 

This is just simple introduction how to easily and quickly add metaboxes to your theme and keep them around even when you change your theme in the future.

How to move your website to new domain

If you are not happy with your domain name or just want to change it to a name that is more search engine friendly, there are some options to consider. Before you register new domain mane, remember that the keywords in your domain name carry the most weight with the search engines. The name you will choose is very important for the success of your website. I think we should have a separate article about importance of keywords in domaine name, but for now you can watch a video in which Matt Cutts is discussing the importance of having your target keywords in your domain name.
So, after you choose your new domain name you can start migrating to a new domain. When you site is build in WordPress, it allows you to transfer your content without starting from scratch. First thing you have to do is to make a backup of your entire WordPress installation and the MySQL database content. You can find more detailed step-by-step instructions here.

It will help you to transfer your website to a new server, or if you need – to change the website’s URL.

Most of the host companies can help you transfer your WordPress site. You may even be eligible for a free content transfer service after you upgrade your plan with some host providers.

When moving your domain, please don’t forget to cancel your web hosting with your old internet provider.
Need more help? Just leave a comment or shoot us an e-mail.

Your online reputation matters! Yes, it really does!

There are so many ways to think about your business reputation.

With the in-person experiences of customers, your reputation is also affected by your company’s web presence. Whether you manage a brand, yourself or a business, your online reputation is often the first impression potential customers will see. BUT, is your web presence making you or your business sparkle, or is it hurting your business reputation? Are you even paying attention to what your customers are saying about you, your product, your business online?

Your potential customers learn about your business by searching for you online. So, why not to do the same! Search for “your business name reviews“ using search engines like Google, Yahoo, or Bing to see what kinds of reviews your business is getting. This can help you determine what is being said about your business, and where it is being posted.

Try to respond to good reviews via private message, that way you don’t overwhelm your review page with your own comments. When you have a negative review ( it happens…), don’t panic! Apologize for the incident and let the costumer know it will never happen again.

If you have a profile on networks such as LinkedIn, Twitter, Facebook, etc., make sure your bio or information about your business is correct and similar. You don’t want to be one person on your website and completely different on Twitter account, same applies to your business as well.

There are plenty of tools available, that help you monitor your web presence and see how consumers perceive your website or online business. Here are some online reputation monitoring tools worth checking out:

1. BackType Alerts

– BackType (acquired by Twitter ) measures engagement and its impact on KPIs like revenue, page views, sign ups, downloads and more.

2. Me on the Web from Google

– helps you to understand and manage what people see when they search for you on Google. It feels a lot like Google alerts, but is more upfront and user-friendly.

3. Ping and TweekDeck

– help you track or update your entire online presence from a central hub.


On of the nice features of WordPress is moderation of comments people post on your blog. It allows you to prevent comments from appearing on your site without your express approval.

It’s important to build a positive reputation online, TRUST is very important. Your reputation can either build or ruin your whole business, so pay attention to what is being said online about you, your product or services, your business.

Backup your WordPress site

Your files, documents, photos are important! Because they are stored on your local computer, you need to create additional copy (backup), just in case something will happen to your computer or hard drive will die. Same applies to any website, which is stored on similar computer (server), which may contain hundreds of other websites. Every time you edit something, install new plugins or update your WordPress website, there is a risk that something can go wrong. There are many reasons why this can happen – server failure, corrupted database, bad plugin, etc. And don’t forget about hackers, another good reason why any website needs to be backed up.

So, here is the good reason for you to use WordPress, where core team is very good at keeping the core software secure and up to date. If you miss an update – chances are your website may be hacked, and if there is no backup – you may need to start all over again with design and development. And that’s why backup is crucial. How do I backup my site? Simple – export SQL database in PhpMyAdmin and copy files over FTP. Sounds too technical? Ok, WordPress has got plugin(s) for that, here are some of the best ones tested on WordPress 3.2.1

1. Backup Buddy

– the most complete backup of a WordPress site

2. WordPress backup to Dropbox

– complete website backup, excellent if you use DropBox

3. Snapshot backup

– has scheduling available, backs up to your FTP server in zip file

4. WP-DB-Backup

– simple plugin that backs up just database, has scheduling available via email

5. EZPZ One click backup

– real one click backup, both manual and automated backups are available

Basic tips for your website security

Its not a secret – without the proper web security, web site data and files can easily be damaged, changed or stolen. The integrity of your company or your name can be compromised. Your money as well as consumer identities, credit card information (if you have e-commerce web site) are put in jeopardy when protection of a web site and the server isn’t given the top priority.

Website security is a fundamental part of the success of your online business. Making it a priority is critical to your credibility as well as the protection of you and your customers. If you use “password” as your password for everything and have three-year old antivirus software, you are very attractive target to hackers. To protect your business’s reputation and your customers’ information, here are some basic tips for you to consider:

1. Password Should Be Difficult!

One of the simplest ways to improve security is to use strong password and use different ones for your email, banking info, your cPanel,social media accounts and your FTP accounts. When selecting passwords, use both lowercase and uppercase letters, include at least one number. Use at least 7 characters, anything less is considered far too easy to hack. You can increase your password security even more by adding a punctuation character. Just don’t make it too difficult to type or too long to remember. “Password1” is obvious and very easy to guess, as well as using your name or “username” as your password. “$bmMB9889” is very secure, while still being memorable. This kind of password will be very difficult to crack than your pet’s name or your birth date.

2. Change Passwords Often.

After a developer has finished your project ALWAYS change your passwords. It is completely up to you how often you want to change your passwords, but do it at least once in 6 months (some experts advise changing all passwords every 30 days!).

3. Keep Your Software Up-To-Date.

Make applications or website just tough enough to brake by downloading the newest versions and updates of WordPress, Windows and your antivirus platform. This includes any plugins, themes and extensions that accompany scripts. Don’t forget to update your software! Your computer can become an easy target for unscrupulous security crackers if you ignore security updates for too long.

4. Backup! Backup! Backup!

One of the most important ways of protecting yourself from disaster is to back up your data. Without data backup you are running the risk of losing your data. The last thing you want to find when you’ve been attacked and need to re-install your blog is that you don’t have a current database backup. Make it a habit to backup your site regularly!
Having a backup handy will save you time, money and sleepless nights. There could be hundreds of scenarios where you would need a backup.

5. Don’t trust public networks!

You probably love to hang out at you local coffee shop, but do you trust your coffee shop? Of course, you can use a wireless network there if you are smart and careful about security. Try to avoid connecting from networks with unknown or uncertain security characteristics or from those with known poor security. This is especially important whenever you must log in to Web site or the server for some purposes or otherwise access secure resources.

6. Closer look at your links.

One of the main causes for attacks that are perpetrated through browsers are so-called “open redirects”. Do you really know what kind of site you’re linking to from your site? Putting bad links on you site is always a bad idea. Make sure any site you link to is completely trustworthy.

7. Any good hosting out there?

Not all hosts are the same when it comes to ensuring your website’s security. Not all of them can offer round-the-clock active server monitoring. Choose a host that takes your security seriously! It is always better to have some-one to call in case of emergency, so look for hosting with 24/7 support. That way you can contact the support team to get your problem resolved any time of day (or night). Some protection is NOT cheap and can cost you an arm (+leg) so shop around and do some research.
Hostgator

8. Be Smart!

Make your site secure by regularly scanning your log files for code that doesn’t belong. Don’t allow anonymous comments with suspicious links on your blog. Do not install suspicious WordPress plugins and be aware of what’s going on inside your site.

9. Don’t share your login!

Shared login credentials can cause a lot of problems for security. Someone can change the password and not tell you and lock you out. The more login credentials are shared, the greater the number of problems you can be having. Do not keep your password taped to the screen of your computer or laptop! Always log out of any confidential systems or sign off the system completely after you are finished working with it.

Make it a habit to keep an eye on things and keep everything up to date. If you are committed to protecting your data, hackers will have a much harder time to brake your web site and hopefully won’t be able to succeed. Many people are just unaware of their own vulnerability, hackers play with enough websites and eventually they find a vulnerable one to exploit. That web site doesn’t have to be yours!

WordPress 3 custom search

Sometimes there is a need to limit WordPress search to one category. WordPress uses searchform.php template, if your theme doesn’t have this template – generic search form is pulled from WordPress core. In this case you need to create searchform.php file in your theme and insert following

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
<div class="customsearch>
     <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
           <div class="searchinput>
                  <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
                      <?php if ( is_page('22') || in_category('19') || post_is_in_descendant_category( get_term_by( 'name','video','category' ) ) ) { ?>
                 <input type="hidden" name="cat" value="19" />
                     <?php } else {} ?>
                  <input type="submit" id="searchsubmit" value="Search" />
            </div><!--endsearchinput-->
     </form>
</div><!--end customsearch-->

In this case we have page (ID=22) which displays parent category “video” with ID 19, and we need to search only this category and all child categories. Just replace IDs.