0

In some parts of my template, like in the header of my Wordpress website, I have custom text like "Any question ? Contact us: +33 00 11 22 33".

These texts are managed as a page : in the template, I make a WP_Query to get this page content based on its slug and I echo it here.

But something is scaring me : as I use Yoast SEO and I make SEO generally speaking, I think that thanks to the sitemap, these texts will be accessible from search engines, as single pages...

Do you see some way to hide them from search engines, or another way to integrate dynamic rich text to some parts of my templates ?

  • 2
    I like to create a custom settings page, and in my template I just use a get_option. A good starting point may be this article on site point sitepoint.com/… – czerspalace Aug 6 '15 at 22:17
  • It looks quite tricky... For example, I dont like the idea to write raw HTML in php functions, and I guess it will make some problems for rich text WYSIWYG editing – maxime Aug 6 '15 at 22:19
0

After some practice, I found two ways to do this prettier:

  • As a text widget: You just have to define a widget area in your template. After this, in Appearance>Widget, you can add a "Text" widget in this area, with any free HTML code. It can do the trick for the ones who write HTML

  • As a settings page: Thanks @czerspalace for your answer ! The solution can be to do a settings page. Instead of writing the code in functions.php, the way I found to do this is using the Pods plugin. It allows to create Settings pages really easily, with a WYSIWYG if you need it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.