Support » Fixing WordPress » How to fix Fatal error: Cannot redeclare add_term_meta()

  • hi this is my web site

    Fatal error: Cannot redeclare add_term_meta() (previously declared in /home/supremea/public_html/wp-includes/taxonomy.php:1571) in /home/supremea/public_html/wp-content/plugins/hide-for-group-roles/index.php on line 941

    can you help me for fix this error.

    Thank you

Viewing 15 replies - 1 through 15 (of 16 total)
  • The plugin “hide for group roles” is trying to re-declare a function that’s already been declared by the WordPress system. The easy way to fix this is to remove that plugin.

    And make custom taxonomy files, it’s quite touchy and should be custom made.

    how to remove plugin, i can’t login back end?

    FTP into your site (or use whatever file management application your host provides) & delete, or rename, the wp-content/plugins/hide-for-group-roles folder.

    Ok, I’ll add to Esmi advice, delete this file for now, but you can work to improve it later on.

    What i missed to explain, is any bad error with taxonomy can lead to fatal error (yeah, happened to me while testing sometimes). But it code is well written you make safeguards and messages, aka (if huge error, echo huge isssue to check).

    Thbings to check on line Z …

    Normally you’ll have at least where the code crashed by line,

    With sound php knowledge (not my case) you can stuff the bug in 2 mlns in general.
    With average php knowledge and good knowledge of
    WP infrastrucure (main queries, DB, so on..) it takes me in general 10 minutes to debug it without files at hand.

    If you can, you can use a code management tool to open dozens fils at once. It also help for the whole stuffy (in addition to a few regex).

    thanks all reply, problem resolved, but i have a doubt about delete hide-for-group-roles folder, is this affect any other function on web site?

    Hi. I fixed it in an other way (without deactivate it).


    Yes shemzone, that works.

    But… what happens when the plugin is updated and you loose that change? You’ll be back to where you were before.

    I know that the plugin was last updated over a year ago so the chances of it being updated now are… not as great as they could be, but it’s still a valid concern. It’s also not great that you’ve posted your request in the right forum, but never got an answer. That shows that the author doesn’t look at the support forum much, which again does happen.

    That’s all why I believe that it’s a better idea to remove that plugin and use something that doesn’t have a breaking issue in it in the first place. Others may disagree, but I never like using plugins that I can’t trust like that.

    @catacaustic, yes, you are absolutely right. But I hope that, if the plugin is back on stage, this error will be the first to be corrected…
    I hope as well that the author will read our posts on this issue…
    For now, I have not found another plugin that does the job and, if it exists, I would have too much work to modify each content/category and so on, to work with another plugin.
    So, for now, at least for me, it’s the best solution.


    Well good if solution was found. Anyways, most plugin authors give away plugin support because they can’t earn a living with it so, it’s not something we can complain about.

    What you can do shemzone, is contact him, and maybe make a team with him to work on that plugin on a long term partnership.
    I don’t see either another plugin doing same job.



    Fatal error: Cannot redeclare add_term_meta() (previously declared in /home/panchhifashion/public_html/wp-includes/taxonomy.php:1251) in /home/panchhifashion/public_html/wp-content/plugins/taxonomy-metadata/metadata.php on line 97

    first i solve error. to your answer and rename file taxonomy files so website is working but if i login wp-admin/ i show error and not any more full page blank…

    plz explain how to fix this problem…. i attached image Link —–>>

    Hi everyone, I have this problem too, but I do not have a wp-content/plugins/hide-for-group-roles folder. Also, I can’t login to WP admin because I get the error. Should I delete the taxonomy-metadata folder under plugins?

    I deleted the taxonomy-metadata folder, and now I can get back into Admin, but if I try to install the Taxonomy plugin again, the error comes back. Should I try deleting taxonomy.php? I did try pasting in two other versions of the file (one by one) but both of those threw errors (with the plugin not reinstalled).

    Well, I learned not to delete taxonomy.php. I restored it, installed the Hide for Groups (roles) plugin, and tried shemzone’s solution from the linked thread, but no dice.

    Hi @eiteews, it’s located at /www/wp-content/plugins/hide-for-group-roles
    Rename the file “index.php” or modify the functions (around line 938)

    Hi everyone.
    Download my index.txt (to be renamed to index.php) including my modifications and try again (/www/wp-content/plugins/hide-for-group-roles/index.php)

    • This reply was modified 3 years, 4 months ago by shemzone.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘How to fix Fatal error: Cannot redeclare add_term_meta()’ is closed to new replies.