Editing Sharing in Slack

#517636
  • Resolved Sergey
    Rank Math free

    Hi I am using wordpress multisite on my project and would like to use different author names on different subsites. Now I have my admin account name everywhere, but I want to put a unique name on each subsite in the Sharing in Slack microdata. How can I do it?

Viewing 15 replies - 1 through 15 (of 29 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    You can use and customize this filter to update the author names in Slack depending on the subsite you’re using:

    add_filter( "rank_math/opengraph/slack/twitter_data1", function( $content ) {
    	return;
    });
    
    add_filter( "rank_math/opengraph/slack/twitter_label1", function( $content ) {
    	return;
    });

    And here’s a guide to adding the code to the website:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Thank you.

    Sergey
    Rank Math free

    Can you provide me with an example?
    For example, author Mike Blossom for domain.com and by Don Manchester for domain.com/fr/
    (where domain.com/fr/ is a subsite in wordpress multisite)

    Nigel
    Rank Math business

    Hello,

    The (untested) example below only changes the author name ‘admin’ to something else like ‘French Author Name’ depending on whether the URL contains ‘/fr/’ or ‘/it/’ etc:

    
    add_filter( "rank_math/opengraph/slack/twitter_data1", function( $content ) {
    	$requesturi = $_SERVER['REQUEST_URI'];
    	if (strpos($requesturi,'/fr/')){
    		return 'French Author Name';
    	}
    	if (strpos($requesturi,'/it/')){
    		return 'Italian Author Name';
    	}
    	return 'Default Author Name';
    });
    

    Hope that helps. Please let us know if you have questions.

    Sergey
    Rank Math free

    I tried to do as you said and added the appropriate function to my theme’s functions.php file, but it didn’t work

    Hello,

    Please share some of the websites in this multisite so we can check what the data being outputted looks like on them and advise further.

    Looking forward to hearing back from you.

    Sergey
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Sergey
    Rank Math free

    I gave you access to my site

    Nigel
    Rank Math business

    Hello,

    I have adjusted the code snippet to the one below and it is working now:

    
    add_filter( "rank_math/opengraph/slack/twitter_data1", function( $content ) {
    	$requesturi = $_SERVER['REQUEST_URI'];
        
    	if (strstr($requesturi,'/fr/')){
    		return 'Sophie Marois';
    	}
    	if (strstr($requesturi,'/it/')){
    		return 'Adrian Diefenbach';
    	}
        if (strstr($requesturi,'/en/')){
    		return 'Aleksa Radulovic';
    	}
    	return 'Raphael Hösli';
    });
    

    Hope that helps. Please let us know if you have questions.

    Sergey
    Rank Math free

    Yes, it works, but these tags are missing from the subsites. what is the reason?
    <meta name=”twitter:label2″ content=”…” />
    <meta name=”twitter:data2″ content=”…” />

    Hello,

    We deeply apologize for the delay in response.

    I checked your subsite URLs and it seems both meta tags are there in all of your subsite URLs.

    Please refer to the screenshots attached in the sensitive data section.

    Looking forward to helping you.

    Thank you.

    Sergey
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Sergey
    Rank Math free

    I see this issue on internal subitem pages
    I supplemented Sensitive Data with a link to a screenshot of the problem and a link to the page where this problem is. But this is not an isolated case.

    Hello,

    Please follow the steps mentioned below:

    #1 ~ The plugin is outdated:

    The current FREE version of Rank Math you’re using is not the updated one. Please update the plugin to the latest FREE version (v1.0.107.3) of Rank Math.

    Changelog: https://rankmath.com/changelog/free/

    #2 ~ The plugin is active on the network:

    Please make sure that you activate the plugin not on the network but on each subsite individually which is the best way to use our plugin.

    This is true for both the Free and PRO plugins as the network activation makes some functionality not work as expected.

    Hence, please install Rank Math to each subsite individually rather than installing directly on the network.

    Once you’ve fixed the issue mentioned above, please try adding the filter mentioned above to each subsite individually.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Sergey
    Rank Math free

    I followed your advice and updated the plugin to the latest version – it didn’t help. Then I disabled it for the network of sites and activated it for each site separately – but then the plugin only worked on the main site, but did not work at all on the internal ones. Please help me to solve this problem. You have access to the site – see what’s wrong

    Hello,

    You need to have the plugin active on each subsite individually and we changed to that implementation. The plugin was not showing on the subsites for you because you haven’t run the Setup Wizard on all the subsites.

    We also updated the filter to show the author on the language websites according to your specifications.

    Please note that custom modifications to our plugin and extensive code snippets as this one fall outside the scope of our support so if you need further modifications beyond the ones we already offered and applied to the website you’ll need to consult with a web developer.

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 15 replies - 1 through 15 (of 29 total)

The ticket ‘Editing Sharing in Slack’ is closed to new replies.