Tagged: , ,

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1066708

    Hello,

    I was having some trouble finding a solution to this as the other post :
    https://kriesi.at/support/topic/how-to-remove-the-author-link-in-posts/

    is slightly outdated.

    Incase anyone needs to remove the url for security reasons (author name shows actual username aka “admin” or similar, which can allow bots to bruteforce passwords for accurate users)

    The code you need to replace is now located on line 296.

    Here is the code I input

                            echo '<span class="blog-author minor-meta">'.__('by','avia_framework')." ";
                            echo '<span class="entry-author-link" >';
                            echo '<span class="vcard author"><span class="fn">';
    // changed the_author_posts_link(); to the_author(); to remove author URL from blog posts for security reasons.
                            the_author();
                            echo '</span></span>';
                            echo '</span>';
                            echo '</span>';

    This does not need a reply by Development.

    Thank you

    #1067270

    Hey haydaw,

    Thanks for sharing that, it’s much appreciated :-)

    Best regards,
    Rikard

    #1081486

    I’m curious why this isn’t done by default?

    Assuming there is a good reason…

    Is there any way of adding this change to child theme functions.php, and/or at least something more permanent, rather than having to manually change this after each theme update?

    Thanks

    #1081515

    Yes, EdgeWP, The question of why constantly recurring requests are not finally set as an option and every time here “support” is made, I ask myself again and again.

    #1081822

    I guess I’m not questioning the removal of the permalink itself..

    But, since NickName is a required field for every user.. and there I assume for both anonymity as well as security. (security being more my concern!)

    I just don’t understand when the Display Name Publicity is set to use NickName…

    Why on earth would the permalink reflect the actual User Name and not the NickName?

    An afterthought of continued updates that was never considered or addressed maybe?

    Not sure, but for now, I guess I’ll just add this as one more thing needed to be done after each theme update…

    Unless someone might suggest an alternative, and/or more permanent solution?

    #1082353

    Hi EdgeWP,

    Wordpress websites were mainly for posts originally and so it is a normal thing to show the post author, of course, it’s not supposed to be an admin and sometimes it is important for SEO, so by default author is shown on posts built with the Advanced Layout Builder.

    Best regards,
    Victoria

    • This reply was modified 5 years, 8 months ago by Victoria.
    #1308391

    Dear haydaw,
    Thanks a lot for sharing the updated solution to this problem. Very helpful!

    Dear Enfold-team,
    May I come back to the follow-up question EdgeWP already touched above.

    Is there a way to prevent the change in wp-content\themes\enfold\includes\loop-index.php from being overwritten by future theme updates?

    I am already running a child theme. How can I replace a php-file in the includes-folder of the parent theme by a modified php-file located in the child theme folder? I guess it’s necessary to add some code to functions.php (similar to the activation of custom ALB shortcodes)?

    Can you help with this?

    Thanks and best,

    Hagen

    #1308686

    Hi,
    Thank you for your patience, to add a modified \includes\loop-index.php to your child theme simply add the directory and file to your child theme like this \wp-content\themes\enfold-child\includes\loop-index.php
    no functions are needed. I tested this with v4.8.3
    The correct line to modify in \includes\loop-index.php is 443

    Best regards,
    Mike

    #1309281

    Dear Mike,
    I just found the time to test your solution. It works perfect! Thank you very much.
    Another – probably stupid – question: My installation now uses the modified loop-index.php file located in the child theme. What happens if the original loop-index.php file is being modified with one of the upcoming updates? How will I notice? Will everything crash? :-)
    Thanks again and best regards,
    Hagen

    #1309382

    Hi,
    Glad that helped, any new function in the loop-index.php should work, only the currently named functions in your child theme would be overwritten. If one of those functions was changed you probably would not know until some new feature doesn’t work. Our Dev team is very careful about backward compatibility so I doubt you would have a crash but you could compare files before updating.
    I recommend creating a staging site to test all updates before applying them to your live site, as a standard procedure.

    Best regards,
    Mike

    #1310322

    Dear Mike,
    Thanks a lot for your clear and precise response. I highly appreciate that.
    Sorry to bother you with the following follow-up question: Is there a similar way to remove the category- and tag-URLs from the posts’ source code?
    Thanks and best regards,
    Hagen

    #1310493

    Hi,
    I didn’t find a similar solution but you could try adding this code to the end of your functions.php file in Appearance > Editor:

    function meta_custom_href_remove(){
    ?>
    <script>
    (function($){
      $(document).ready(function(){
      $('.blog-tags.minor-meta a').contents().unwrap();
      $('.blog-categories.minor-meta a').contents().unwrap();
      });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'meta_custom_href_remove');

    Best regards,
    Mike

    #1313056

    Hi Mike!
    Thanks again.
    Unfortunately, the code doesn’t seem to work on my end.
    Please find the URL of an example page in the private content area. Although your funtion is executed when the page is loaded, the category-URL can still be found in line 287 of the source code and the tag-URL in line 500.
    Do you have any idea why it didn’t work as intended?
    Thanks and best regards,
    Hagen

    #1313200

    Hi,
    I guess I overlooked the importance of removing this from your “source code”, the script I posted removes the links from the DOM so that it is not visible to visitors or search engines.
    To remove this completely from the source code look in your child theme \loop-index.php and remove line 494:
    remove_tags_from_loop-index.png
    and lines 338 – 344
    remove_cats_from_loop-index.png
    please give this a try.

    Best regards,
    Mike

    #1314704

    Dear Mike,
    Thank you so much! That’s exactly what I was looking for. It works perfectly fine.
    Btw, I think it would be good to put this information into the standard Enfold documentation. I could imagine that everyone who is keen on having a clean page in terms of SEO / crawling budget would be interested in this little modification.
    Thanks again and best regards,
    Hagen

    #1314802

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘How to remove author URL on blog posts for security reasons’ is closed to new replies.